Motion: [BUG] [iOS13] whileTap doesn't animate back to initial props when interrupted with scrolling

Created on 1 Sep 2019  Â·  5Comments  Â·  Source: framer/motion

Description

whileTap should animate back to initial element props when tap is over, but that doesn't happen when starting a scroll from the tap target.

Environment

• iOS 13.1 beta (17A5821e) (also on iOS 13.0 builds)
• Safari

Demo

https://codesandbox.io/s/runtime-night-f0o8i
Kapture 2019-09-01 at 7 19 04

bug

Most helpful comment

Is this a problem related to framer motion or is it a temporary bug in safari on iOS 13? On iOS 12 it works like a charm.
I'm asking because the touch-action: none solution doesn't cut it for me because I want to build a table-like layout where every cell is clickable, needless to say that touch-action: none doesn't work here because scrolling wouldn't work anymore.

All 5 comments

Seems connected to https://github.com/framer/motion/issues/281, adding touch-action: none to the tap target stops the scrolling from happening and enforces the tap always finishes.

Is this a problem related to framer motion or is it a temporary bug in safari on iOS 13? On iOS 12 it works like a charm.
I'm asking because the touch-action: none solution doesn't cut it for me because I want to build a table-like layout where every cell is clickable, needless to say that touch-action: none doesn't work here because scrolling wouldn't work anymore.

It doesn't work on Android either. Generally it would be great if those events e.g. whileTap are not triggered in the first place if ontouchmove is true.

Not sure if this is what's causing the issue, but when I start scrolling onPointerCancel event is fired, and because of this onPointerUp never gets called. Looking at the source of whileTap https://github.com/framer/motion/blob/44f36a31c02bf63eaf3b34153326fa44a0ff712c/src/gestures/use-tap-gesture.ts

I don't see anything related to this cancel event, perhaps it should trigger same actions as onpointerUp ?

Did anyone find a solution to this issue? I'm having same problem when scrolling a listView with Clickable cards.

Was this page helpful?
0 / 5 - 0 ratings