buttonwoodcx / bcx-aurelia-dnd

Aurelia Drag and Drop.
https://buttonwoodcx.github.io/doc-bcx-aurelia-dnd
MIT License
21 stars 2 forks source link

source element blocks <a> route jump on mobile device #6

Closed 3cp closed 4 years ago

3cp commented 6 years ago

https://discourse.aurelia.io/t/bcx-aurelia-reorderable-repeat-supresses-click/1638/13

Something about touchstart event handler on mobile devices. Aurelia DefaultLinkHandler uses global click handler to handle route jump. Needs more investigation.

3cp commented 4 years ago

The cause is touchstart event handler on the anchor (dnd source) element. It calls preventDefault to disable html body scroll, but that scrolling fix also disabled browser's fallback to simulate click after touchend (without touchmove).

There is no much I can do, rather than the work around in the discourse thread.

Use dnd-handler to limit the area responsive to touchstart. Like this:

<a 
  reorderable-repeat.for="item of [1,2,3]"
  reorderable-dnd-handler-selector=".handler"
  route-href="route: dashboard"
>
    <div><span class="handler">[ ]</span> ${item}</div>
</a>