thisbeyond / solid-dnd

A lightweight, performant, extensible drag and drop toolkit for Solid JS.
https://solid-dnd.com
MIT License
483 stars 33 forks source link

How to start dragging only after timeout (long tap activator)? #115

Open iamcsharper opened 1 week ago

iamcsharper commented 1 week ago

I'm building a popup with a series of full-width slides, one for each day. Each day has a sortable list of cards.

I want to make it so that users can only start dragging and sorting the cards if they long-press on them (meaning they hold their finger down for at least one second).

How can I implement this using solid-dnd? Any suggestions or examples you can provide would be greatly appreciated!

iamcsharper commented 1 week ago

image

martinpengellyphillips commented 1 week ago

So the default sensor has a delay but it is not currently customisable. Now there is a use case, I'll look at making that customisable.

In the meantime, you'll need to copy that sensor code into a custom sensor, modify it as you need and register it instead as the sensor you want to use.