clauderic / dnd-kit

The modern, lightweight, performant, accessible and extensible drag & drop toolkit for React.
http://dndkit.com
MIT License
11.9k stars 602 forks source link

Draggable Touch Events only working on Long Press #1398

Open rockman4417 opened 1 month ago

rockman4417 commented 1 month ago

Hey guys! I have added a TouchSensor to my DndContext, but for some reason, on my iPad, my Draggable elements are only activating on Long Press. Any idea why this is? I would like the Drag event to fire with as minimal delay as possible and be highly sensitive.

My TouchSensor is defined here

import { useSensor, useSensors, TouchSensor, DndContext } from "@dnd-kit/core";

const touchSensor = useSensor(TouchSensor, {
    // Press delay of 0ms, with tolerance of 5px of movement
    activationConstraint: {
      delay: 0,
      tolerance: 5,
    },
  });

const sensors = useSensors(touchSensor);

And then I pass the sensors into my DndContext wrapper like so

  <DndContext sensors={sensors}>
      {draggable items}
  </DndContext>

Thanks!