FocusClearingController
Coordinates focus-clearing requests with a composition's FocusManager. Call Bind while requests should be handled.
Requests are unbuffered and are dropped without an active binding. Multiple bindings all receive each request. Dispatch stops when scope is cancelled.
Parameters
scope
Scope used to dispatch focus-clearing requests.
requests
Unbuffered stream shared by requesters and active bindings.
Functions
Link copied to clipboard
fun Bind(focusManager: FocusManager = LocalFocusManager.current, clearOnKeyboardHidden: Boolean = true, force: Boolean = false)
Handles requests with focusManager while present in the composition. Optionally also clears focus after the IME changes from visible to hidden.
Link copied to clipboard
Asynchronously requests focus clearing from every active Bind. The request is dropped if none is active.