pub struct ModalOptions {
pub tab_trap: bool,
}Expand description
Options for Context::modal_with.
Controls focus behavior when a modal overlay is active.
§Example
if show {
ui.modal_with(slt::context::ModalOptions { tab_trap: true }, |ui| {
ui.text("Are you sure?");
if ui.button("OK").clicked { show = false; }
});
}Fields§
§tab_trap: boolWhen true, Tab/Shift+Tab navigation cannot leave the modal’s focus
range, even if Context::set_focus_index or a mouse click moved
focus outside.
Default: true — aligned with WCAG 2.1 SC 2.4.3 (Focus Order),
which recommends trapping focus inside modal dialogs.
Set to false to preserve the legacy behavior where focus could
escape via programmatic means.
Trait Implementations§
Source§impl Clone for ModalOptions
impl Clone for ModalOptions
Source§fn clone(&self) -> ModalOptions
fn clone(&self) -> ModalOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ModalOptions
impl Debug for ModalOptions
Source§impl Default for ModalOptions
impl Default for ModalOptions
impl Copy for ModalOptions
Auto Trait Implementations§
impl Freeze for ModalOptions
impl RefUnwindSafe for ModalOptions
impl Send for ModalOptions
impl Sync for ModalOptions
impl Unpin for ModalOptions
impl UnsafeUnpin for ModalOptions
impl UnwindSafe for ModalOptions
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