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

AutoHeight breaks on mobile when using dvh units #7863

Open
5 of 6 tasks
DonSqualo opened this issue Jan 22, 2025 · 0 comments
Open
5 of 6 tasks

AutoHeight breaks on mobile when using dvh units #7863

DonSqualo opened this issue Jan 22, 2025 · 0 comments

Comments

@DonSqualo
Copy link

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/sandbox/swiper-autoheight-forked-xzjhl4

Bug description

When using dynamic units within the slide, AND the slide is initialized WHILE the mobile browser UI is visible, THEN the height calculation is incorrect.

Workaround: ResizeObserver that calls swiper.updateAutoHeight(1) when the window.innerHeight changes

Expected Behavior

The whole content of a Slide should be visible (height should match the content height)

Actual Behavior

On page load the last line of the first slide is not visible because height is to low. When you swipe to the next slide and down (hiding the menu), then swipe back, you CAN see the content.

Swiper version

latest

Platform/Target and Browser Versions

tested on mobile chrome and firefox

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant