MCPcopy
hub / github.com/adobe/react-spectrum / pointerEvent

Function pointerEvent

packages/react-aria/test/interactions/useHover.test.js:38–51  ·  view source on GitHub ↗
(type, opts)

Source from the content-addressed store, hash-verified

36}
37
38function pointerEvent(type, opts) {
39 let evt = new Event(type, {bubbles: true, cancelable: true});
40 Object.assign(
41 evt,
42 {
43 ctrlKey: false,
44 metaKey: false,
45 shiftKey: false,
46 button: opts.button || 0
47 },
48 opts
49 );
50 return evt;
51}
52
53describe('useHover', function () {
54 beforeAll(() => {

Callers 2

useHover.test.jsFile · 0.70
InnerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected