Using slick inside of a flexbox element causes slick to grow exponentially
See original GitHub issueIf you initialize a slick carousel inside of a flexbox element, then the slick carousel increases it’s width exponentially. The carousel ends up being extremely wide!
I know that flexbox is not quite ready for production, but Bootstrap 4 is shipping with the option to enable flexbox framework-wide. If this is something easy to fix, then perhaps it would be worthwhile to do so for us early adopters of Bootstrap 4 😃
http://jsfiddle.net/derekfoulk/x3Luhwqm/1/
Steps to reproduce the problem
- Wrap your carousel element with an element
- Set
display: flex;
on that element
What is the expected behaviour?
I expected the slick carousel to stay @ 100% width of the flexbox element.
What is observed behaviour?
The slider starts out much wider than the parent (flexbox) element, and continues to grow wider after each iteration of the carousel.
More Details
- I have verified this behavior on current & recent versions of Chrome, Firefox & Edge
- Using slick v1.6.0
- I’m unsure if this has worked as intended with previous versions of slick
Issue Analytics
- State:
- Created 7 years ago
- Reactions:16
- Comments:31
Top Results From Across the Web
Slick slider not working in a flex container - Stack Overflow
in a column. So I use display: flex; align-items: center; on the column (container of the slick slider) but it breaks the slider....
Read more >Slick Slider in Felxbox Fix - Addison Legere
Have a container around your slider inside of your flexbox and you should be all set.
Read more >views.view.html.twig - usage of row class [#3057897] - Drupal
For example I am using a Slick carousel view with Barrio theme and ... slick inside of a flexbox element causes slick to...
Read more >Slick Slider/Edge-To-Edge Movement - ADocLib
Using slick inside of a flexbox element causes slick to grow exponentially. slick. 20 June 2016 Posted by DerekFoulk. If you initialize a...
Read more >Create slick CSS layouts with Flexbox - Creative Bloq
We've turned the section into a 'flex container'. The elements in a flex container are flex items and adhere to the rules of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@alamowo , In fact, “overflow:hidden;” add to the “flex:1” div (not the “slick-slider” div) fixed this bug In my case.
for flexbox is solved by adding to the parent element { min-width: 0; }