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

Function onPress

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

Source from the content-addressed store, hash-verified

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

Callers 1

usePressFunction · 0.50

Calls 1

startDraggingFunction · 0.70

Tested by

no test coverage detected