FormidableLabs / FormidableLabs/react-swipeable

Touch tap results in mouse events

Offen
#231 9 Kommentare 3 Reaktionen 1 zugewiesene Person Beansprucht von @hartzis Auf GitHub ansehen
bug 🐛 has example ✅ has solution ✅
Vorherrschende Sprache
TypeScript
Sterne
2.1k
Forks
149
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

**Describe the bug**
Tapping in the component tracked by the handlers causes multiple handlers to be called

1. The `onTap` handler is called with event of type `touchend`
1. The `onSwiping` handler is called with some delta values
1. The `onTap` handler is called twice, both with event of type `mouseup`

**Steps or Sandbox to reproduce**
Observe the following codesandbox application console log when touch-tapping in the blue area.

https://codesandbox.io/s/react-swipeable-tap-bug-yrbyu

**Expected behavior**
WHEN both `trackMouse` and `trackTouch` options are set to `true`
GIVEN a single touch tap in the component
THEN only `onTap` handler is called, with one event of type `touchend`

**Device/Browser**
Tested on
* Dell XPS with touch screen, running Fedora 34, in Firefox, Chrome and Brave
* Samsung Galaxy S10, running Android 11, in Chrome and Brave

Sliding/swiping works very well in all the mentioned environments, but a single touch tap also gives the same result in all of them.

**Additional context**
The _react-swipeable_ hook as such is very time saving and smooth! Thanks for the great work!

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.