androidx.compose.foundation.text.contextmenu.modifier
filterTextContextMenuComponentsSince 1.9
Function · from org.jetbrains.compose.foundation:foundation:1.12.2
No hand-written docs yet.
Adds a filter to be run when the text context menu is shown within this hierarchy.
Parameters
fun Modifier.filterTextContextMenuComponents(
filter: (TextContextMenuComponent) -> Boolean,
): Modifier
filter: (TextContextMenuComponent) -> BooleanRequired
filter: (TextContextMenuComponent) -> BooleanRequireda snapshot-aware lambda that determines whether a TextContextMenuComponent should be included in the context menu.
Library docs
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.
filters added via this modifier will always run after every builder added via
Modifier.appendTextContextMenuComponents``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``appendTextContextMenuComponents have been applied,
but the order in which they run should not be depended on.