ampproject / ampproject/amphtml

elements inside amp-carousel are randomly jumping out of of

Open
#39,811 1 comment 6 reactions 1 assignee Claimed by @erwinmombay View on GitHub
Component: amp-carousel needs sizing P1: High Priority Type: Bug WG: components
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

### Description

I've found that while using an , randomly there is a unexpected behaviour where the content that should be inside the "i-amphtml-carousel-scroll", stays as a direct child of and breaks the carousel behaviour.

Expected Behaviour:
```js

```
What is happening:
```js


... My items here...

```

When it breaks(left), vs expected behaviour(right)
![Screenshot 2024-02-09 at 09 38 20](https://github.com/ampproject/amphtml/assets/151949601/a0ff2151-bb44-4b4a-9a74-6d96159931d7)
Comparison from the html structure when it breaks vs expected:
![Screenshot 2024-02-09 at 09 49 12](https://github.com/ampproject/amphtml/assets/151949601/031ae778-0149-426f-9a52-b2e5449aba91)

### Reproduction Steps

The issue about replicating this, is that so far the behaviour seems completly random, so it may need a lot of trial and error:
1. Go to https://www.ucpa.com/
2. Notice the carousel
3. Refresh until it breaks

There are other carousels along the website that are breaking. Again with varying frequency.
Sorry If I can't provide more specific reproduction steps, but I haven't found a way to isolate the issue. Other pages, staging vs production, whatever it is there is not a way to consistently break it. The best I have found is that having "Disable cache" in the network tab seems to mitigate the issue, making it more rare, but still happens.

### Relevant Logs

```shell
This error is not producing any console logs
```

### Browser(s) Affected

Chrome

### OS(s) Affected

MacOS

### Device(s) Affected

Macbook pro m1

### AMP Version Affected

2401262004000

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.