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

Prevent touchstart event if startEvent has already been registered #360

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fredrikekelund
Copy link

This PR implements or fixes...

We used this library for a website that was being run on a kiosk. The Kiosk runs Chrome/Chromium on a system called Kioware with a large touch screen that supports multi touch. With this configuration, a strange issue popped up – namely that sometimes visitors would start dragging elements and find that the mirror elements were left behind and never removed. After some initial trouble reproducing the issue, we found that using two fingers to tap two different elements at the same time reliably reproduced the issue. See this screencast for an illustration of the issue (in it I tap multiple times with two fingers simultaneously on different draggable items): https://www.dropbox.com/s/ssyllrws4y5hgnt/Draggable%20multi%20touch%20bug.MP4?dl=0

To fix this I added a simple check in the onTouchStart handler that prevents the event if this.startEvent has already been registered. Initially I checked if this.dragging was truthy, but this didn't work since that property was only being set after the delay timeout callback had been run.

This PR closes the following issues...

I didn't submit an issue (and no issue seems to have described this problem before)

Does this PR require the Docs to be updated?

No

Does this PR require new tests?

No

This branch been tested on...

Browsers:

  • Chrome version
  • Firefox version
  • Safari version
  • IE / Edge version
  • iOS Browser 12.4
  • Android Browser version

Fredrik Ekelund added 2 commits August 12, 2019 17:02
Previously this property would only be reset if `this.dragging` was
truthy. This didn't match the behaviour of the onTouchStart handler,
we have to always reset it to match that method.
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

Successfully merging this pull request may close these issues.

None yet

1 participant