pub enum TabIndex {
Auto,
OverrideInParent(usize),
NoKeyboardFocus,
}
Variants§
Auto
Automatic tab index, similar to simply setting focusable = "true"
or tabindex = 0
(both have the effect of making the element focusable).
Sidenote: See https://www.w3.org/TR/html5/editing.html#sequential-focus-navigation-and-the-tabindex-attribute for interesting notes on tabindex and accessibility
OverrideInParent(usize)
Set the tab index in relation to its parent element. I.e. if you have a list of elements, the focusing order is restricted to the current parent.
Ex. a div might have:
ⓘ
div (Auto)
|- element1 (OverrideInParent 0) <- current focus
|- element2 (OverrideInParent 5)
|- element3 (OverrideInParent 2)
|- element4 (Global 5)
When pressing tab repeatedly, the focusing order will be “element3, element2, element4, div”, since OverrideInParent elements take precedence among global order.
NoKeyboardFocus
Elements can be focused in callbacks, but are not accessible via keyboard / tab navigation (-1)
Implementations§
Trait Implementations§
Source§impl Ord for TabIndex
impl Ord for TabIndex
Source§impl PartialOrd for TabIndex
impl PartialOrd for TabIndex
impl Copy for TabIndex
impl Eq for TabIndex
impl StructuralPartialEq for TabIndex
Auto Trait Implementations§
impl Freeze for TabIndex
impl RefUnwindSafe for TabIndex
impl Send for TabIndex
impl Sync for TabIndex
impl Unpin for TabIndex
impl UnwindSafe for TabIndex
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)