pub struct FocusRequester {
pub target: Rc<RefCell<Option<u64>>>,
}Expand description
A handle that can programmatically request focus for a widget.
Similar to Compose’s FocusRequester. Create one via remember(FocusRequester::new),
attach it via .focus_requester(...) on a modifier, and call request_focus() to
move keyboard focus to the associated widget on the next frame.
Fields§
§target: Rc<RefCell<Option<u64>>>Target view ID, set during layout/paint by the modifier system.
Implementations§
Source§impl FocusRequester
impl FocusRequester
pub fn new() -> Self
Sourcepub fn request_focus(&self)
pub fn request_focus(&self)
Request focus for the associated widget on the next frame.
Sourcepub fn free_focus(&self)
pub fn free_focus(&self)
Free/clear focus from the associated widget on the next frame.
If the associated widget currently has focus, focus is cleared entirely.
Corresponds to Compose’s freeFocus().
Sourcepub fn capture_focus(&self)
pub fn capture_focus(&self)
Request focus for the associated widget on the next frame,
bypassing some focusability checks. Corresponds to Compose’s
captureFocus(), which is typically used internally by the focus system.
In repose this is an alias for request_focus().
Trait Implementations§
Source§impl Clone for FocusRequester
impl Clone for FocusRequester
Source§fn clone(&self) -> FocusRequester
fn clone(&self) -> FocusRequester
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more