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

Function onFocusOut

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

Source from the content-addressed store, hash-verified

154 };
155
156 let onFocusOut: EventListener = e => {
157 if (isBlurFromActiveElement(getEventTarget(e) as Element) || isRefocusing) {
158 e.stopImmediatePropagation();
159
160 // If there was no focusable ancestor, we don't expect a focus event.
161 // Re-focus the original active element here.
162 if (!target && !isRefocusing) {
163 isRefocusing = true;
164 focusWithoutScrolling(activeElement);
165 cleanup();
166 }
167 }
168 };
169
170 let onFocus: EventListener = e => {
171 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