MCPcopy Index your code
hub / github.com/adobe/react-spectrum / shouldRestoreFocus

Function shouldRestoreFocus

packages/react-aria/src/focus/FocusScope.tsx:612–623  ·  view source on GitHub ↗
(scopeRef: ScopeRef)

Source from the content-addressed store, hash-verified

610}
611
612function shouldRestoreFocus(scopeRef: ScopeRef) {
613 let scope = focusScopeTree.getTreeNode(activeScope);
614 while (scope && scope.scopeRef !== scopeRef) {
615 if (scope.nodeToRestore) {
616 return false;
617 }
618
619 scope = scope.parent;
620 }
621
622 return scope?.scopeRef === scopeRef;
623}
624
625function useRestoreFocus(
626 scopeRef: RefObject<Element[] | null>,

Callers 2

onKeyDownFunction · 0.85
useRestoreFocusFunction · 0.85

Calls 1

getTreeNodeMethod · 0.80

Tested by

no test coverage detected