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

Function onPress

packages/react-aria/src/dnd/useDrag.ts:312–318  ·  view source on GitHub ↗
(e: PressEvent)

Source from the content-addressed store, hash-verified

310 }, [state]);
311
312 let onPress = (e: PressEvent) => {
313 if (e.pointerType !== 'keyboard' && e.pointerType !== 'virtual') {
314 return;
315 }
316
317 startDragging(e.target as HTMLElement);
318 };
319
320 let startDragging = (target: HTMLElement) => {
321 if (typeof state.options.onDragStart === 'function') {

Callers 1

usePressFunction · 0.50

Calls 1

startDraggingFunction · 0.70

Tested by

no test coverage detected