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

Function pointer

packages/dev/s2-docs/pages/s2/home/Mobile.tsx:343–349  ·  view source on GitHub ↗
(ref: RefObject<FocusableRefValue<HTMLElement> | null>, type: string)

Source from the content-addressed store, hash-verified

341}
342
343function pointer(ref: RefObject<FocusableRefValue<HTMLElement> | null>, type: string) {
344 ref.current
345 ?.UNSAFE_getDOMNode()!
346 .dispatchEvent(
347 new PointerEvent(type, {pointerType: 'mouse', pointerId: 1, bubbles: true, detail: 1})
348 );
349}
350
351function fakeFocus(node: HTMLElement, type: 'focus' | 'blur') {
352 Object.defineProperty(document, 'activeElement', {value: node, configurable: true});

Callers 1

performFunction · 0.70

Calls 1

UNSAFE_getDOMNodeMethod · 0.80

Tested by

no test coverage detected