Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draggable Touch Events only working on Long Press #1398

Open
rockman4417 opened this issue May 9, 2024 · 0 comments
Open

Draggable Touch Events only working on Long Press #1398

rockman4417 opened this issue May 9, 2024 · 0 comments

Comments

@rockman4417
Copy link

rockman4417 commented May 9, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant