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

Function dispatchVirtualFocus

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

Source from the content-addressed store, hash-verified

20}
21
22export function dispatchVirtualFocus(to: Element, from: Element | null): void {
23 to.dispatchEvent(createFocusEvent('focus', {relatedTarget: from}));
24 to.dispatchEvent(createFocusEvent('focusin', {bubbles: true, relatedTarget: from}));
25}
26
27export function getVirtuallyFocusedElement(document: Document): Element | null {
28 let activeElement = getActiveElement(document);

Callers 5

useComboBoxFunction · 0.90
useSelectableCollectionFunction · 0.90
onChangeFunction · 0.90
onFocusFunction · 0.90
moveVirtualFocusFunction · 0.85

Calls 1

createFocusEventFunction · 0.85

Tested by

no test coverage detected