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