Draggable: How to prevent drag from starting when scrolling on a touch device?

Created on 9 Sep 2020  路  4Comments  路  Source: Shopify/draggable

I have a long list of Sortables. When I scroll the list on a touch device, I don't want the Sortables to start.

I've added a delay--but it's not behaving as I would expect. If I hold and scroll (I think a lot of people do this), after the delay, the Sortable will start even though I don't want it to. How do I get the Sortable to start only after holding in place for the duration of the delay?

All 4 comments

Hi,

What version of Draggable are you using? It seem that v1.0.0-beta.11 has some issues about the delay option, we will try to find it out later.
For now, may you try v1.0.0-beta.10 instead? Just add delay and it will work as you expected 馃槃

  const sortable = new Sortable(containers, {
    draggable: '.Block--isDraggable',
    delay: 200,
  });

@pumpknhd Thanks for bug reporting, v1.0.0-beta.11 can reproduce this.

Yes I'm using v1.0.0-beta.11. The problem with going back to v1.0.0-beta.10 is that it doesn't have the exclude options to allow disable default plugins and sensors. I need to disable the Focusable plugin.

We will fix this bug in the next version. Now you can try the PR above, it can fix this bug.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AStoker picture AStoker  路  3Comments

f15gdsy picture f15gdsy  路  3Comments

indirectlylit picture indirectlylit  路  3Comments

noloop picture noloop  路  5Comments

asaelz picture asaelz  路  5Comments