-
-
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
Resizing on container resize instead of window resize #4019
Comments
This is what I've come up with so far:
Use with It leverages events from the MutationObserver module (observer.js) to trigger I would go as far as saying that this should be integrated in |
Fixed with 5f80052 |
I've just tested v6.5.0 and resizing the viewport does not update swiper. I haven't had time to further investigate the issue, but for now I'm reverting to using my module. |
If issue persists, please provide a live example/fiddle with the issue |
I figured it out: in order for Does enabling |
This is a:
I'd like to suggest implementing the ResizeObserver API as proposed years ago in #2068 .
Browser support is now more widespread and this would really help in cases where CSS is loaded asynchronously ("non-critical"). Consider for instance this situation:
One reason to NOT implement the ResizeObserver API would be that if the slider is shown above-the-fold, then all .swiper-container's style should already be loaded and therefore there would be no problem. Otherwise, i.e. swiper loaded "below-the-fold", then lazy initialize it using IntersectionObserver as even async styles are likely to have been loaded at this point.
However, consider this case:
This clearly breaks proper slide sizing which uses Swiper's internal methods
updateSize()
andupdateSlides()
.The text was updated successfully, but these errors were encountered: