Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slider breaks when inside container with flex-grow #387

Open
MR-Mostafa opened this issue Nov 8, 2023 · 4 comments
Open

Slider breaks when inside container with flex-grow #387

MR-Mostafa opened this issue Nov 8, 2023 · 4 comments

Comments

@MR-Mostafa
Copy link

Hi
The slider breaks in containers where flex-grow is set to 1.
In this case, this bug relates to #227 and #229.

Your solution

adding overflow: hidden; to your wrapper (.main) will fix the width calculation.

However, does not work when we use special slider configurations like perView: 3
Also I used slider.update({ slides: { perView: 3, spacing: 15 }}); but dosen't work correctly;

https://stackblitz.com/edit/keen-slider-flex-bug

@MR-Mostafa
Copy link
Author

In addition, I cannot assign class overflow-hidden to a parent element. (flex-auto).
However, I have given this class's overflow-hidden to its direct parent.

@MR-Mostafa
Copy link
Author

MR-Mostafa commented Nov 8, 2023

also when i used overflow-hidden for flex-auto, It seems that there is another bug and that is calculates the number of slide items incorrectly.

update for calculate pagination:

(This bug occers when loop:false)

@welschmoor
Copy link

welschmoor commented Jan 3, 2024

I have made the experience that keen-slider does not work well with tailwind. I remember I wanted to make the "div" that had the keen slider ref on it be relative and used the tailwind class relative and it did not work. Then I wrapped the slider with a relative div and it did not work. This was React and what worked is using style={{ position: "relative" }}. This may only affect React. top-2 left-4 did not work either, I had to use the style property.

@chimok
Copy link

chimok commented Feb 21, 2024

@welschmoor The keen-slider.io website use tailwind. Problem is a container with flex or padding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants