<div class='type'>Compose Modifier</div>

<a id='references'></a>


<h2 id="filtertextcontextmenucomponents-filter">filterTextContextMenuComponents</h2>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun Modifier.filterTextContextMenuComponents(
    filter: (TextContextMenuComponent) -> Boolean
): Modifier
```


Adds a `filter` to be run when the text context menu is shown within this hierarchy.

`filter` will not be passed `TextContextMenuSeparator`, as they pass by default.

`filter`s added via this modifier will always run after every `builder` added via
`Modifier.appendTextContextMenuComponents`. When there are
multiple instances of this modifier in a layout hierarchy, every `filter` must pass in order for
a context menu to be shown. They are always applied after all
`Modifier.appendTextContextMenuComponents` have been applied,
but the order in which they run should not be depended on.

#### Parameters

| | |
| --- | --- |
| filter | a snapshot-aware lambda that determines whether a `TextContextMenuComponent` should be included in the context menu. |