akiran / react-slick

React carousel component
http://react-slick.neostack.com/
MIT License
11.72k stars 2.1k forks source link

Slider wrapps slides #1549

Open Skippidar opened 5 years ago

Skippidar commented 5 years ago

As we can see in example of jQuery slick slider - it uses inner divs as slides and just adds necessary classes (like 'slick-slide') to them

Bur react version of slick always wrapps children divs into div with class 'slick-slide' and div with no class (by the way, if I set option 'slide' to 'ul' or any other tag - slider continues to use div)

Is it possible not to wrap children divs and wor as jQuery version of slick slider?

xiaotian-tan commented 5 years ago

I'm having exact problem as well as shown below

<div> // <== This is the div that react-slick added to each slide
    <div class="item step-1 slick-slide" tabindex="-1" style="width: 100%; display: inline-block;">
        Slide Content
    </div>
</div>
<div>
    <div class="item step-2 slick-slide" tabindex="-1" style="width: 100%; display: inline-block;">
        Slide Content
    </div>
</div>
verybluebot commented 5 years ago

same issue exactly

tusharshuklaa commented 4 years ago

I'm also facing the exact same issue and I really wish react-slick would have followed the same behaviour. I can see this issue is getting older day-by-day and still getting no traction at all. @akiran Can you please look into this?

Virtouzo commented 4 years ago

Confronted this problem too.

cryptic022 commented 4 years ago

Do you have any jquery example of how it works exactly? I couldn't find any usage example in jquery slick documentation.

Skippidar commented 4 years ago

Do you have any jquery example of how it works exactly? I couldn't find any usage example in jquery slick documentation.

https://codesandbox.io/s/react-slick-playground-mc60p (v1.8.1 of jQuery Slick version) As I can see, jQuery version has same structure as React version. image

https://codesandbox.io/s/react-slick-playground-2h9zk (v1.8.0 of jQuery Slick version) But 1.8.0 version's structure differs from react's. image

React-slick uses 1.8.1, so it's not react-slick's bug. But maybe let people choose version of slick to use with react-slick?

Skippidar commented 4 years ago

https://github.com/kenwheeler/slick/compare/1.8.0...v1.8.1#commitcomment-24906670