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

Function onBlur

packages/react-aria/src/autocomplete/useAutocomplete.ts:498–509  ·  view source on GitHub ↗
(e: ReactFocusEvent)

Source from the content-addressed store, hash-verified

496 // Be sure to clear/restore the virtual + collection focus when blurring/refocusing the field so we only show the
497 // focus ring on the virtually focused collection when are actually interacting with the Autocomplete
498 let onBlur = (e: ReactFocusEvent) => {
499 if (!e.isTrusted) {
500 return;
501 }
502
503 let lastFocusedNode = queuedActiveDescendant.current
504 ? document.getElementById(queuedActiveDescendant.current)
505 : null;
506 if (lastFocusedNode) {
507 dispatchVirtualBlur(lastFocusedNode, e.relatedTarget);
508 }
509 };
510
511 let onFocus = (e: ReactFocusEvent) => {
512 if (!e.isTrusted) {

Callers

nothing calls this directly

Calls 1

dispatchVirtualBlurFunction · 0.90

Tested by

no test coverage detected