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

updateAutoHeight doesn't update when newHeight is 0 #5281

Closed
6 tasks done
pjetrucha opened this issue Dec 9, 2021 · 0 comments
Closed
6 tasks done

updateAutoHeight doesn't update when newHeight is 0 #5281

pjetrucha opened this issue Dec 9, 2021 · 0 comments

Comments

@pjetrucha
Copy link

pjetrucha commented Dec 9, 2021

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/s/swiper-autoheight-forked-4rq8q

Bug description

Hi,
First of all, thank you for a great tool which is Swiper!

I have a situation where my slides may be empty (0 height). With the autoHeight: true setting enabled, the script does not refresh heights for these empty slides.

This is due to this condition:

if (newHeight) swiper.$wrapperEl.css('height', `${newHeight}px`);

Currently the only way for this to work is to set a min-height: 1px, but ideally this would be fixed in the script. Is there any reason this condition exists?

Expected Behavior

No response

Actual Behavior

No response

Swiper version

4e7a160

Platform/Target and Browser Versions

all

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