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

Making things draggable blocks touch scrolling #61

Open
graphics-et-al opened this issue Sep 30, 2022 · 4 comments · May be fixed by #134
Open

Making things draggable blocks touch scrolling #61

graphics-et-al opened this issue Sep 30, 2022 · 4 comments · May be fixed by #134
Labels
enhancement New feature or request

Comments

@graphics-et-al
Copy link

First of all: this is a brilliant library- I've been looking for a drag and drop lib like this for a while.

But: I've got a long scrollable list of scrollable images that I want to drag and drop onto a page. When on a desktop: mousewheel, arrows, page up/down works fine. On a touchscreen, however the expected swipe to scroll doesn't happen- probably because of this:

// On mobile, touch can become extremely janky without it node.style.touchAction = 'none';

Is there a way around this? Is there a way to add a delay to the action so that a swipe won't trigger the dragging, but holding for a half second will?

Cheers!

@PuruVJ
Copy link
Owner

PuruVJ commented Nov 14, 2022

I could add an option touchDelay: number for this, but definitely need to investigate this further

@PuruVJ PuruVJ added the enhancement New feature or request label Nov 14, 2022
@jesperordrup
Copy link

Hi @PuruVJ

We have a maybe similar usecase. We're horisontally dragging containers. Works fine. But we cant scroll up/down

image (8)

Have you any ideas?

In a "manual vanilla example" we register mouse position on mousedown, evaluate if mouse move horisontally is more than a treshhold and only then prevents scrolling

@AlexSapple
Copy link

nasty workaround - using an important modifier on default class DragOption - something like; defaultClass: "!touch-pan-y" Not sure what nasties this brings about - but does appear to allow touch/gesture scrolling along with a drag.

@PuruVJ
Copy link
Owner

PuruVJ commented Dec 17, 2024

I recently added a threshold property to the library https://www.neodrag.dev/docs/svelte#threshold, you could set delay to a non-zero number and see if it works.

If not, I'm currently working on v3 which will be modular allowing you to write plugins. So you could do that as well

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

Successfully merging a pull request may close this issue.

4 participants