metafizzy / metafizzy/flickity

Strange behaviour cellAlign. Sometime works correctly, other times no.

Open
#1,309 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
7.6k
Forks
593
PR merge metrics
No merged PRs in 30d

Description

![img1](https://github.com/user-attachments/assets/862d9a92-f435-42b9-be16-c01d57b76e5e)
![img2](https://github.com/user-attachments/assets/7bd10eeb-688d-41f5-b1b6-607a2cb35fd7)
![img3](https://github.com/user-attachments/assets/73468fff-56ea-4b61-8a84-faf959685d61)

Hi, I am new to this library and I think this is awesome.
I don't know if I miss something but I found a strange behaviour using cellAlign: left (default).
Sometimes the cell is not completely aligned on left like in img1 and img2.
If I open the Inspector, then it works correctly, even if I close it.
But if I refresh the page, it returns to render incorrectly.
I tried on different PC, browsers, even on my friend's PC.
Is this normal?

Code:
```



Document


* {
box-sizing: border-box;
}

.main-carousel {
border: 1px solid red;
}

.carousel-cell {
border: 1px solid green;
height: 250px;
width: 250px;
}

```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the supplied HTML reproduction using Flickity 2, especially the data-flickity options for cellAlign and contain. Compare the initial layout after refresh with the layout after opening and closing the browser Inspector. Done means identifying and fixing the condition that causes the cells to render inconsistently so left alignment is stable on initial load.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.