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

Function onFocusOut

packages/react-aria/src/interactions/utils.ts:162–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160 };
161
162 let onFocusOut: EventListener = e => {
163 if (isBlurFromActiveElement(getEventTarget(e) as Element) || isRefocusing) {
164 e.stopImmediatePropagation();
165
166 // If there was no focusable ancestor, we don't expect a focus event.
167 // Re-focus the original active element here.
168 if (!target && !isRefocusing) {
169 isRefocusing = true;
170 focusWithoutScrolling(activeElement);
171 cleanup();
172 }
173 }
174 };
175
176 let onFocus: EventListener = e => {
177 if (isFocusMovingToTarget(getEventTarget(e) as Element) || isRefocusing) {

Callers

nothing calls this directly

Calls 4

getEventTargetFunction · 0.90
focusWithoutScrollingFunction · 0.90
isBlurFromActiveElementFunction · 0.85
cleanupFunction · 0.85

Tested by

no test coverage detected