Skip to content

Why does touch on mobile Safari cause animation to pause/slow down? #75

Open
@richpixel

Description

@richpixel

I've setup 2 animated routes like so:

        <AnimatedRoute
          path="(/|^.+?index.html)" exact
          component={MainScreen}
          atEnter={{ offset: -100 }}
          atLeave={{ offset: -100 }}
          atActive={{ offset: 0 }}
          className="switch-wrapper"
          mapStyles={mapStyles}
        />
        <AnimatedRoute
          path="/results"
          component={ResultsScreen}
          atEnter={{ offset: 100 }}
          atLeave={{ offset: 100 }}
          atActive={{ offset: 0 }}
          className="switch-wrapper"
          mapStyles={mapStyles}
        />

These work perfectly until running on iOS/Safari... I'm triggering the animation with a swipe left. However, if I keep my finger down after the animation has started running, for some reason it pauses and then appears tied to the motion of my finger. This actually would be a nice effect, however after I let go the animation completes with a 'jittery' finish. I was able to disable this effect by adding:

onTouchStart={e => e.preventDefault()}

to the div that accepts the swipe gesture. However I'm wondering if this feature is documented anywhere or is preventable? Or is this a feature of React Motion?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions