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

Breakpoint not working reliably when having a min-width configured on any parent element e.g. body #7451

Open
5 of 6 tasks
Ruben-check24 opened this issue Apr 8, 2024 · 2 comments
Labels
t0ggles Linked to the t0ggles task

Comments

@Ruben-check24
Copy link

Ruben-check24 commented Apr 8, 2024

Check that this is really a bug

  • I confirm

Reproduction link

Bug description

Breakpoints work fine but as soon as I add a min-width to any parent Element of the swiper and its greater or equal to the breakpoint, it doesn't work reliably anymore when the window gets resized (slowly).
I added a min-width of 1024px on a div above the swiper (common thing to do on desktop is to have such min-width on the body) and on the swiper I have a breakpoint at 1024px to show 5 slides. The effect/bug is even more noticeable/occurs more often when the min-width of the div is greater than the breakpoint. You have to resize the window pretty fast for swiper to react to it correctly. With breakpointBase="container" it seems to work perfectly fine.

Similar Demo in react with different values which makes it more noticeable. min-with is much higher than the breakpoint: codesandbox

Demo VIdeo

2024-04-08.11.20.08.mp4

Expected Behavior

No matter the "resize speed", breakpoint should be handled correctly and reliably when a parent element has a 'min-width' set

Actual Behavior

When a parent Element has a min-width that is equal or larger than the breakpoint, the breakpoint does't trigger reliable anymore

Swiper version

11.1.0

Platform/Target and Browser Versions

macOS Chrome, Firefox, Safari

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR
@nolimits4web
Copy link
Owner

t0ggles-create swiper

Copy link

t0ggles bot commented Apr 8, 2024

Task nolimits4web/SWIPER-88 was created

t0ggles task SWIPER-88

@t0ggles t0ggles bot added the t0ggles Linked to the t0ggles task label Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t0ggles Linked to the t0ggles task
Projects
None yet
Development

No branches or pull requests

2 participants