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

"slide" Setting Doesn't Work #2148

Open
simon-online opened this issue Apr 11, 2022 · 3 comments
Open

"slide" Setting Doesn't Work #2148

simon-online opened this issue Apr 11, 2022 · 3 comments

Comments

@simon-online
Copy link

It seems like the "slide" setting doesn't work. In the documentation it says:

slide
Type: string
Default: 'div'
Description: Slide container type

However when I try to change the slide container type to a section element instead it remains a div. Also I notice that when I set the react key prop on each slide it doesn't work. The key prop seems to be getting set to something different to what I set.

Here is my example that is attempting to change the slide container type to a section element.
https://codesandbox.io/s/react-slick-playground-forked-jylzjv

@TharinduK97
Copy link

It is not much clear about the issue. But we can use slide attributes with other relevant attributes. And it is good to post what kind of Carousel component you tried to use?? I have posted some code below. I think you can get an idea from it.
`function App() {
const [array, serArray]=useState([1,2,3,4])

var settings = {
dots: true,
infinite: true,
speed: 500,
slide: "section",
slidesToShow: 1,
slidesToScroll: 1
};

return (


<Slider {...settings}>
{

      array.map((m,index)=>{
        return(
        <section key={index}>
          {m}
        </section>
        )
      })
    }
   
  </Slider>
</div>

);
}

export default App;`

@gtb104
Copy link

gtb104 commented Jun 15, 2022

I also believe that the slide property is not used. I've looked through the code and do not see where it's used. Could you point out where it's used?

@eins78
Copy link

eins78 commented Oct 14, 2022

there is no slide prop. there is swipe for turning swiping behaviour on or off and a prop initialSlide to define the starting slide (note its "initial" because its not a controlled prop - the Slider keeps its own state)

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

4 participants