onPreviewPasteEvent

fun Modifier.onPreviewPasteEvent(onPreviewPasteEvent: (event: PasteEvent) -> Boolean): Modifier

Adding this modifier to the modifier parameter of a component will allow it to intercept pasted text before its children, like a text field, receive it. For example, to insert a placeholder in place of a large paste.

Parameters

onPreviewPasteEvent

This callback is invoked when text is pasted into the terminal, before the children of this node. Return true to stop propagation of this event. If you return false, the event will be sent to this onPreviewPasteEvent's children, and if none of them consume it, back up to the root through the onPasteEvent callbacks.