jkomoros / card-web

The web app behind thecompendium.cards
Apache License 2.0
46 stars 8 forks source link

Discard card gestures with long durations. #546

Closed albernackee closed 2 years ago

albernackee commented 2 years ago

Selecting text on iPhone/iPad triggers navigation similar to issue #455 which was fixed for desktop in https://github.com/jkomoros/card-web/commit/2f6e1c8bea346ef58a4f5f10eb888f6d38b24b7d. This change switches to use the duration of the gesture to detect if it's likely a swipe or not.

May want to add back in the check for 'mouseup' if quick swipes with a mouse should not be supported or this regresses on desktop text selection too much. Looks like Apple's default gesture duration is 100ms, but went with 200ms for now since users cannot adjust.

Quick demo video here.