Skip to content

With the <amp-carousel> 0.2 script, the right arrow sometimes shows on the last slide #25510

@kienstra

Description

@kienstra

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

  1. Checkout this PR's branch, and activate Twenty Nineteen
  2. Create a new post
  3. Add a Gallery block
  4. Add only one image to it, like this
  5. Select 'Display as carousel'
  6. Click 'Preview,' and go to the AMP URL
  7. Expected: Because there's only 1 image in the carousel, there shouldn't be a right arrow
  8. Actual: There's a right arrow, but clicking it doesn't do anything:

carousel-here

  1. Create another Gallery block, but with at least 2 images
  2. Select 'Display as carousel'
  3. Click 'Preview,' and go to the AMP URL
  4. Expected: When the last slide in the carousel displays, the right arrow shouldn't be visible
  5. Actual: It's still visible:

last-slide

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions