Skip to content

Commit

Permalink
Revert "Don't update position as we scroll (#17507)" (#17762)
Browse files Browse the repository at this point in the history
* Add regression manual test

* Revert "Don't update position as we scroll (#17507)"

This reverts commit 3553c5b.
  • Loading branch information
cathyxz authored Aug 29, 2018
1 parent 844a589 commit 124eb0d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions extensions/amp-carousel/0.1/scrollable-carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ export class AmpScrollableCarousel extends BaseCarousel {
*/
scrollHandler_() {
const currentScrollLeft = this.container_./*OK*/scrollLeft;
this.pos_ = currentScrollLeft;

if (this.scrollTimerId_ === null) {
this.waitForScroll_(currentScrollLeft);
Expand Down
30 changes: 30 additions & 0 deletions test/manual/amp-carousel-scroll-regression.amp.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!doctype html>
<html >
<head>
<meta charset="utf-8">
<title>AMP #0</title>
<link rel="canonical" href="amps.html" >
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<link href='https://fonts.googleapis.com/css?family=Questrial' rel='stylesheet' type='text/css'>
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-carousel" src="https://cdn.ampproject.org/v0/amp-carousel-0.1.js"></script>
</head>
<body>
<amp-carousel height="300"
layout="fixed-height"
type="carousel">
<amp-img src="https://ampbyexample.com/img/image1.jpg"
width="400"
height="300"
alt="a sample image"></amp-img>
<amp-img src="https://ampbyexample.com/img/image2.jpg"
width="400"
height="300"
alt="another sample image"></amp-img>
<amp-img src="https://ampbyexample.com/img/image3.jpg"
width="400"
height="300"
alt="and another sample image"></amp-img>
</amp-carousel>
</body>
</html>

0 comments on commit 124eb0d

Please sign in to comment.