pub struct FocusScopeProps {
pub loop: MaybeProp<bool>,
pub trapped: MaybeProp<bool>,
pub on_mount_auto_focus: Option<Callback<Event>>,
pub on_unmount_auto_focus: Option<Option<Callback<Event>>>,
pub as_child: MaybeProp<bool>,
pub attrs: Vec<(&'static str, Attribute)>,
pub children: ChildrenFn,
}
Expand description
Props for the FocusScope
component.
§Required Props
- attrs: [
Vec<(&'static str, Attribute)>
] - children:
ChildrenFn
§Optional Props
- r#loop:
impl Into<MaybeProp<bool>>
- When
true
, tabbing from last item will focus first tabbable and shift+tab from first item will focus last tababble. Defaults tofalse
.
- When
- trapped:
impl Into<MaybeProp<bool>>
- When
true
, focus cannot escape the focus scope via keyboard, pointer, or a programmatic focus. Defaults tofalse
.
- When
- on_mount_auto_focus:
impl Into<Callback<Event>>
- on_unmount_auto_focus:
impl Into<Option<Callback<Event>>>
- as_child:
impl Into<MaybeProp<bool>>
Fields§
§loop: MaybeProp<bool>
When true
, tabbing from last item will focus first tabbable and shift+tab from first item will focus last tababble. Defaults to false
.
trapped: MaybeProp<bool>
When true
, focus cannot escape the focus scope via keyboard, pointer, or a programmatic focus. Defaults to false
.
on_mount_auto_focus: Option<Callback<Event>>
§on_unmount_auto_focus: Option<Option<Callback<Event>>>
§as_child: MaybeProp<bool>
§attrs: Vec<(&'static str, Attribute)>
§children: ChildrenFn
Implementations§
Source§impl FocusScopeProps
impl FocusScopeProps
Sourcepub fn builder() -> FocusScopePropsBuilder<((), (), (), (), (), (), ())>
pub fn builder() -> FocusScopePropsBuilder<((), (), (), (), (), (), ())>
Create a builder for building FocusScopeProps
.
On the builder, call .r#loop(...)
(optional), .trapped(...)
(optional), .on_mount_auto_focus(...)
(optional), .on_unmount_auto_focus(...)
(optional), .as_child(...)
(optional), .attrs(...)
(optional), .children(...)
to set the values of the fields.
Finally, call .build()
to create the instance of FocusScopeProps
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FocusScopeProps
impl !RefUnwindSafe for FocusScopeProps
impl !Send for FocusScopeProps
impl !Sync for FocusScopeProps
impl Unpin for FocusScopeProps
impl !UnwindSafe for FocusScopeProps
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more