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

Function onBlur

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

dispatchVirtualBlurFunction · 0.90

Tested by

no test coverage detected