Skip to content

Commit

Permalink
Prevent vertical swipe when attachent is open. (#38211)
Browse files Browse the repository at this point in the history
  • Loading branch information
processprocess committed May 20, 2022
1 parent 6140d3c commit ecffe34
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/amp-story-player/amp-story-player-impl.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ export class AmpStoryPlayer {
/** @private {?Element} */
this.nextButton_ = null;

/** @private {boolean} */
this.pageAttachmentOpen_ = false;

return this.element_;
}

Expand Down Expand Up @@ -1616,6 +1619,7 @@ export class AmpStoryPlayer {
*/
onPageAttachmentStateUpdate_(pageAttachmentOpen) {
this.updateButtonVisibility_(!pageAttachmentOpen);
this.pageAttachmentOpen_ = pageAttachmentOpen;
this.dispatchPageAttachmentEvent_(pageAttachmentOpen);
}

Expand Down Expand Up @@ -1791,7 +1795,7 @@ export class AmpStoryPlayer {
* @param {!Object} gesture
*/
onSwipeX_(gesture) {
if (this.stories_.length <= 1) {
if (this.stories_.length <= 1 || this.pageAttachmentOpen_) {
return;
}

Expand Down

0 comments on commit ecffe34

Please sign in to comment.