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

Function dispatchVirtualBlur

packages/react-aria/src/focus/virtualFocus.ts:16–19  ·  view source on GitHub ↗
(from: Element, to: Element | null)

Source from the content-addressed store, hash-verified

14}
15
16export function dispatchVirtualBlur(from: Element, to: Element | null): void {
17 from.dispatchEvent(new FocusEvent('blur', {relatedTarget: to}));
18 from.dispatchEvent(new FocusEvent('focusout', {bubbles: true, relatedTarget: to}));
19}
20
21export function dispatchVirtualFocus(to: Element, from: Element | null): void {
22 to.dispatchEvent(new FocusEvent('focus', {relatedTarget: from}));

Callers 3

onBlurFunction · 0.90
onFocusFunction · 0.90
moveVirtualFocusFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected