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

Breakpoints based on Container width and not window width with ResizeObserver #4244

Closed
katerlouis opened this issue Feb 17, 2021 · 2 comments
Closed

Comments

@katerlouis
Copy link
Contributor

@katerlouis katerlouis commented Feb 17, 2021

Is your feature request related to a problem? Please describe.
I have a swiper instance with 3 slides. When they all fit inside the container, I want to disable sliding and all controls and just use swiper as a layout. When they don't fit the parent any longer, I want "swiper to be an actual slider with certain swiper settings"

Describe the solution you'd like
containerBreakpoints: {} property that works just as breakpoints: {} does, but using ResizeObserver for width changes and not window.matchMedia() or window.resize()

Describe alternatives you've considered
I guess I could do something similar myself. But I'm too afraid to run into bugs. Swiper is pretty complex and I've run into a lot of issues over the years, when trying fancy stuff with updating settings and killing and re-initializing the instance etc.

@katerlouis katerlouis changed the title Breakpoints based on Contaner width and not window width (like element queries) Breakpoints based on Contaner width and not window width with ResizeObserver Feb 17, 2021
@katerlouis katerlouis changed the title Breakpoints based on Contaner width and not window width with ResizeObserver Breakpoints based on Container width and not window width with ResizeObserver Feb 17, 2021
@ettoredn
Copy link
Contributor

@ettoredn ettoredn commented Feb 23, 2021

Does this fix #4019 and #2218 ?

@nolimits4web
Copy link
Owner

@nolimits4web nolimits4web commented Feb 24, 2021

@ettoredn yes, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants