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

Function onContextMenu

packages/react-aria/src/menu/useMenuTrigger.ts:151–157  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

149
150 let {contextMenuProps} = useContextMenu({
151 onContextMenu(e) {
152 // This is not a DOM event, so the linter is incorrect.
153 // eslint-disable-next-line rsp-rules/safe-event-target
154 let rect = e.target.getBoundingClientRect();
155 state.setPoint({x: rect.x + e.x, y: rect.y + e.y});
156 state.open();
157 }
158 });
159
160 useEffect(() => {

Callers

nothing calls this directly

Calls 4

getEventTargetFunction · 0.90
setPointMethod · 0.80
openMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected