Function

captureFocus

Deny requests to clear focus.

captureFocus

Common
fun FocusRequesterModifierNode.captureFocus(): Boolean

Deny requests to clear focus.

Use this function to send a request to capture focus. If a component captures focus, it will send a FocusState object to its associated onFocusChanged modifiers where FocusState.isCaptured() == true.

When a component is in a Captured state, all focus requests from other components are declined.

Returns

true if the focus was successfully captured by one of the focus modifiers associated with this FocusRequester. False otherwise.