Compose Modifier

filterTextContextMenuComponents

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

AddFilterToTextContextMenu

@Sampled
@Composable
fun AddFilterToTextContextMenu() {
    val textFieldState = rememberTextFieldState()
    BasicTextField(
        state = textFieldState,
        modifier =
            Modifier.filterTextContextMenuComponents(
                filter = { component -> component.key === ClearKeyDataObject }
            ),
    )
}
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: