Constructor FocusScopeSettings
- Namespace
- Velvet
- Assembly
- Velvet.Docs.dll
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 engine-native 2D navigation. Record structural equality simplifies DiffProps.
public FocusScopeSettings(bool Contain = false, bool RestoreFocus = false, bool AutoFocus = false, bool SingleTabStop = false)
Parameters
ContainboolTab/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 unless it landed in a contained scope created after this one. 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, as does focus that moves to another panel unless it lands in a portal declared inside the scope or in a contained scope created after this one.
RestoreFocusboolOn unmount while holding focus, refocus the element that held focus when the scope mounted (skipped if that element is gone, detached, or cannot grab focus).
AutoFocusboolOn 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).
SingleTabStopboolThe 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. An arrow/d-pad move steps to the next member in hierarchy order (right, down) or the previous one (left, up) and never leaves the subtree; Orientation ignores one axis's moves and Wrap continues past an end.