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

Function isElementInScope

packages/react-aria/src/focus/FocusScope.tsx:481–489  ·  view source on GitHub ↗
(element?: Element | null, scope?: Element[] | null)

Source from the content-addressed store, hash-verified

479}
480
481function isElementInScope(element?: Element | null, scope?: Element[] | null) {
482 if (!element) {
483 return false;
484 }
485 if (!scope) {
486 return false;
487 }
488 return scope.some(node => nodeContains(node, element));
489}
490
491function isElementInChildScope(element: Element, scope: ScopeRef = null) {
492 // If the element is within a top layer element (e.g. toasts), always allow moving focus there.

Callers 9

FocusScopeFunction · 0.85
focusNextFunction · 0.85
focusPreviousFunction · 0.85
onKeyDownFunction · 0.85
onFocusFunction · 0.85
isElementInChildScopeFunction · 0.85
useAutoFocusFunction · 0.85
acceptNodeFunction · 0.85
removeTreeNodeMethod · 0.85

Calls 1

nodeContainsFunction · 0.90

Tested by

no test coverage detected