Method FocusScope
- Namespace
- Velvet
- Assembly
- Velvet.Docs.dll
FocusScope(VNode?[]?, string?, bool, bool, bool, bool, FocusScopeOrientation, bool)
A focus scope over children, React Aria's FocusScope. It renders no element
around them: they lay out as the parent's own children, between two hidden elements that mark where
the scope starts and ends, as React Aria's renders two hidden spans. To make an existing container
the scope instead, set its FocusScope.
public static ComponentNode FocusScope(VNode?[]? children = null, string? key = null, bool contain = false, bool restoreFocus = false, bool autoFocus = false, bool singleTabStop = false, FocusScopeOrientation orientation = FocusScopeOrientation.Both, bool wrap = false)
Parameters
childrenVNode[]The scope's content.
keystringKey used to disambiguate siblings at the same position.
containboolTab/Shift-Tab wrap within the scope; a 2D/pointer move that exits is snapped back within the same event flush unless it lands in a contained scope created after this one (a press on empty space that clears focus to nothing re-focuses on the panel's next tick, and so 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.
autoFocusboolOn mount (first attach only — never a keyed reorder's re-attach), focus the scope's first focusable element.
singleTabStopboolThe scope behaves as one Tab stop (roving); arrow/dpad moves step between members in hierarchy order and never leave the scope.
orientationFocusScopeOrientationWith
singleTabStop, the axis arrow/dpad moves travel; a move on the other axis is ignored. Not read withoutsingleTabStop.wrapboolWith
singleTabStop, an arrow/dpad move past one end lands on the other. Not read withoutsingleTabStop.
Returns
- ComponentNode
The created ComponentNode.