-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Description
What's the issue?
In an <amp-carousel> using the 0.2 script:
<script async custom-element="amp-carousel" src="https://cdn.ampproject.org/v0/amp-carousel-0.2.js"></script>...sometimes a right arrow appears even when there's only 1 slide, or if the last slide is showing. This issue doesn't appear with the 0.1 script.
Maybe this isn't an issue with AMP HTML, and there's some styling we could apply to prevent this. I first saw this in the AMP Plugin for WordPress: ampproject/amp-wp#3115
How do we reproduce the issue?
Here's a CodePen of it. On changing amp-carousel-0.2.js back to amp-carousel-0.1.js in that CodePen, the issue doesn't appear anymore.
Steps to reproduce in WordPress
- Checkout this PR's branch, and activate Twenty Nineteen
- Create a new post
- Add a Gallery block
- Add only one image to it, like this
- Select 'Display as carousel'
- Click 'Preview,' and go to the AMP URL
- Expected: Because there's only 1 image in the carousel, there shouldn't be a right arrow
- Actual: There's a right arrow, but clicking it doesn't do anything:
- Create another Gallery block, but with at least 2 images
- Select 'Display as carousel'
- Click 'Preview,' and go to the AMP URL
- Expected: When the last slide in the carousel displays, the right arrow shouldn't be visible
- Actual: It's still visible:
This isn't a common issue, and I didn't see it with most Core themes. Maybe there's some styling that Twenty Nineteen has that's associated with this issue.
What browsers are affected?
Chrome Desktop Version 78.0.3904.87 (Official Build) (64-bit)
This issue doesn't seem to exist on Firefox or Safari
Which AMP version is affected?
1911062056110
I first noticed this issue yesterday.

