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

Function onDrag

packages/react-aria/src/dnd/useDrag.ts:237–255  ·  view source on GitHub ↗
(e: DragEvent)

Source from the content-addressed store, hash-verified

235 };
236
237 let onDrag = (e: DragEvent) => {
238 // Prevent the drag event from propagating to any parent draggables
239 e.stopPropagation();
240
241 if (e.clientX === state.x && e.clientY === state.y) {
242 return;
243 }
244
245 if (typeof options.onDragMove === 'function') {
246 options.onDragMove({
247 type: 'dragmove',
248 x: e.clientX,
249 y: e.clientY
250 });
251 }
252
253 state.x = e.clientX;
254 state.y = e.clientY;
255 };
256
257 let onDragEnd = (e: DragEvent) => {
258 // Prevent the drag event from propagating to any parent draggables

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected