-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
Svelte component inside virtual swiper not rendered correctly when prepending slides #4564
Comments
I have made a simpler test case: https://codesandbox.io/s/swiper-svelte-fork-forked-rgxie?file=/App.svelte.
I have implemented this behaviour in the So the problem is that the new slides do not get rendered when prepending a slide, and not an issue in the |
Here in Svelte, you shouldn't use |
Fixes in Swiper 6.6.2. Here is the full working example with logic for example https://github.com/nolimits4web/swiper/blob/master/playground/svelte/Virtual.svelte |
Hello @nolimits4web the svelte example is missing. Any advice how to use it with svelte? |
What You Did
I try to create an online calendar using Framework7, swiper and svelte. I want to create an infinite calendar where the next day gets loaded as soon as the first or last slide is active.
https://codesandbox.io/s/swiper-svelte-fork-forked-r2z7p?file=/App.svelte
In the codesandbox demo, when you swipe two times, so that a new slide gets prepended, the component gets rerendered with wrong properties and therefore show the wrong day. But if I skip the svelte component and include its source code directly in the slider, everything works as expected. You can comment out the svelte component on line 115 and uncomment the div on line 113 to test this behaviour.
The problem occurs only if the
slideTo
method is called. When I append the slides, which does not call theslideTo
method, everything works just fine.Expected Behavior
I expect that svelte components get rendered correctly when prepending them in a slide.
Actual Behavior
The svelte component gets rendered with wrong properties.
The text was updated successfully, but these errors were encountered: