MCPcopy Create free account
hub / github.com/adobe/react-spectrum / isFocusMovingToTarget

Function isFocusMovingToTarget

packages/react-aria/src/interactions/utils.ts:140–141  ·  view source on GitHub ↗
(focusTarget: Element | null)

Source from the content-addressed store, hash-verified

138 // Focus is "moving to target" when it moves to the button or to a descendant of the button
139 // (e.g. SVG icon)
140 let isFocusMovingToTarget = (focusTarget: Element | null) =>
141 focusTarget === target || (focusTarget != null && nodeContains(target, focusTarget));
142 // Blur/focusout events have their target as the element losing focus. Stop propagation when
143 // that is the previously focused element (activeElement) or a descendant (e.g. in shadow DOM).
144 let isBlurFromActiveElement = (eventTarget: Element | null) =>

Callers 2

onFocusFunction · 0.85
onFocusInFunction · 0.85

Calls 1

nodeContainsFunction · 0.90

Tested by

no test coverage detected