Class FocusScopeSettings
- Namespace
- Velvet
- Assembly
- Velvet.Docs.dll
Focus-management behavior for a container subtree: Contain, RestoreFocus, and AutoFocus are straightforward toggles; SingleTabStop is the WAI-ARIA composite-widget (roving) contract adapted to UI Toolkit, where arrow/dpad movement inside the group is already engine-native 2D navigation. Record structural equality simplifies DiffProps.
public sealed record FocusScopeSettings
- Inheritance
-
objectFocusScopeSettings
Constructors
- FocusScopeSettings(bool, bool, bool, bool)
Focus-management behavior for a container subtree: Contain, RestoreFocus, and AutoFocus are straightforward toggles; SingleTabStop is the WAI-ARIA composite-widget (roving) contract adapted to UI Toolkit, where arrow/dpad movement inside the group is already engine-native 2D navigation. Record structural equality simplifies DiffProps.
Properties
- AutoFocus
On mount (the scope's FIRST attach-to-panel, never a re-attach such as a keyed reorder's), focus the scope's first focusable descendant (skipped when focus is already inside the scope).
- Contain
Tab/Shift-Tab wrap within the subtree (computed by a focus ring scoped to it); a 2D/pointer move that exits the subtree is snapped back within the same event flush, wherever it landed. A press on empty non-focusable space clears focus to nothing first — that path re-focuses the scope on the panel's next scheduler tick instead.
- RestoreFocus
On unmount while holding focus, refocus the element focus came FROM when it first entered the scope (skipped if that element is gone, detached, or cannot grab focus).
- SingleTabStop
The subtree behaves as one Tab stop: Tab from inside exits past the remaining members (wrapping within the nearest containing scope, if any); Tab entering from outside — in either direction — lands on the last-focused member, else the scope's first. Members keep tabIndex 0, so engine 2D arrow/dpad navigation inside is untouched.