Slides on the same view
See original GitHub issueWhy my “keen-slider” stay that? Anyone can help me?
When I make any changes to the code, it changes back to its original state one slide at a time, but as soon as I refresh the page or go up to production mode, it reverts back to its original three-slide state - no swiping - in the same place.
{firstNews.mainImage && firstNews.mainImage.asset && (
<div className="keen-slider__slide">
<a href={firstNews?.slug.current}>
<img src={firstNews?.mainImage.asset.url} alt={firstNews?.title}/>
</a>
<div className="slider-description">
<div className="slide-tag">
<span className="latest">HOT NEWS 🔥</span>
{/* <span className="tag">{firstNews?.category.title}</span> */}
<span className="date">{formatDate(firstNews?.publishedAt)}</span>
<span> - </span>
<span className="author">
<a href="https://yagasaki.vercel.app/" target="_blank">Anderson Marlon</a>
</span>
</div>
<a href={firstNews?.slug.current}><h1>{firstNews?.title}</h1></a>
<p>{firstNews?.description}</p>
</div>
</div>
)}
setFirstNews(data[0]), setSecondNews(data[1]), setThirdNews(data[2])
Data is coming from Sanity.io and the SecondNews and ThirdNews is the same than the FirstNews speaking about the code.
Issue Analytics
- State:
- Created a year ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
How to view multiple slides from same Powerpoint ...
Open your PowerPoint file. Open your other Powerpoint file. Now you only see the last one. Correct? OK, go to view and click...
Read more >Choose the right view for the task in PowerPoint
You can view your slides in a variety of ways depending on the task at hand. There are views for creating ... Use...
Read more >How to Link to Another Slide in the Same Presentation
GET THE 5 FREE SLIDES HERE: https://goo.gl/TBZibY▻ CHECK OUT THE SLEEK PPT TEMPLATE: https://goo.gl/dqRPWQLooking for an easy way to link ...
Read more >How To Print Multiple Slides On One Page (Step-by-Step)
Printing Multiple Slides on One PDF Page · Navigate to the File menu · Select Print · Open the Handout options · Select...
Read more >How do we number multiple slides with same number in ...
Have a look at the so-called overlay features of the beamer class. I use \only<>{} in the example below. By the way, the...
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 Free
Top 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
Yes, see this example. https://keen-slider.io/examples#mutation
The plugin used in this example can easily be copied into your project.
@rcbyr thanks for the prompt answer. Let me see if I can get something up.
I didn’t follow this:
I could imagine that the key changes when it shouldn't.
. I don’t know how that would happen though. Right now I was using the image’s URL as the key, which is unique per image, obviously. And my code just has a call to.filter
which has some logic for selecting the images it wants to show in the slider. Basically I have slider for T-Shirts, and based on the selected color, I show only images of that colors. So the sliders do completely change when the user selects a different color. Old slides get taken out and the new ones come in.This use case seemed to be identical to the
Mutation Observer
example in the website, and it does work as expected when I don’t pass thekey
to the children.