FormidableLabs / FormidableLabs/react-swipeable

Touch tap results in mouse events

オープン
#231 コメント 9 件 リアクション 3 件 担当者 1 名 @hartzis が担当を希望しています GitHub で見る
bug 🐛 has example ✅ has solution ✅
主要言語
TypeScript
スター
2.1k
フォーク
149
PR マージ指標
30日以内にマージされた PR はありません

説明

**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!

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。