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

Function createEvent

packages/react-aria/src/interactions/usePress.ts:1077–1090  ·  view source on GitHub ↗
(target: FocusableElement, e: EventBase)

Source from the content-addressed store, hash-verified

1075}
1076
1077function createEvent(target: FocusableElement, e: EventBase): EventBase {
1078 let clientX = e.clientX;
1079 let clientY = e.clientY;
1080 return {
1081 currentTarget: target,
1082 shiftKey: e.shiftKey,
1083 ctrlKey: e.ctrlKey,
1084 metaKey: e.metaKey,
1085 altKey: e.altKey,
1086 clientX,
1087 clientY,
1088 key: e.key
1089 };
1090}
1091
1092interface Rect {
1093 top: number;

Callers 4

usePressFunction · 0.85
pressUpFunction · 0.85
onClickFunction · 0.85
onKeyUpFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected