Skip to content

✨[amp-story-player] Adds swipe-to-next/previous story#27173

Merged
Enriqe merged 4 commits intoampproject:masterfrom
Enriqe:swipe-to-next
Mar 13, 2020
Merged

✨[amp-story-player] Adds swipe-to-next/previous story#27173
Enriqe merged 4 commits intoampproject:masterfrom
Enriqe:swipe-to-next

Conversation

@Enriqe
Copy link
Copy Markdown
Contributor

@Enriqe Enriqe commented Mar 10, 2020

Adds swiping between stories.

Demo (mobile only)

Includes:

  • New handlers for touchstart, touchend, touchmove events sent by the AMP doc.
  • Tests (plus cleaning previous TODOs)

Does not include:

  • RTL support (will come in a follow-up)
  • Scroll issue [amp-story-player] Fix scrolling bug #27184 (swiping on the player will cause a horizontal scroll in the parent page when it has an overflow).
    • Main issue is that the touch event is "swallowed" by the iframe, and there's no way to preventDefault or stopPropagation on it. This can be verified in this demo, notice how the touchEvents are logged outside the iframe but not when they're inside.

Closes #26698
Tracker #26308

@Enriqe Enriqe marked this pull request as ready for review March 10, 2020 15:25
@Enriqe Enriqe requested review from gmajoulet and newmuis March 10, 2020 15:25
@Enriqe Enriqe merged commit 2798117 into ampproject:master Mar 13, 2020
twintwox pushed a commit to twintwox/amphtml that referenced this pull request Mar 24, 2020
* adds swiping

* types

* wrap animations in rAF, add test, decrease animation duration

* fix tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[amp-story-player] Add swipe-to-next story

4 participants