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

collapse: remove overflow hidden even if height does not match perfect #4203

Conversation

gehrisandro
Copy link
Contributor

Sometimes it happens, that the overflow: hidden style remains on the element after it has expanded.

The reason is, that there is a condition checking that the element height as reached the full height, but sometimes the values do not match perfectly. For example, full is 100.5 but el.getBoundingClientRect().height returns 100.4765625.

This PR changes the condition to allow a difference up to 1px.

To be honest, I am not sure, if the condition is necessary at all.

@ekwoka
Copy link
Contributor

ekwoka commented May 11, 2024

I believe it has to do with the fact that function is called at multiple steps, but not totally sure. I think there are more modern features that can make this actually much easier and simpler, but won't satisfy older targets (Animation API, Animating Grid Rows).

@calebporzio calebporzio merged commit 6dcfefc into alpinejs:main May 13, 2024
1 check passed
@calebporzio
Copy link
Collaborator

Thanks!

@gehrisandro
Copy link
Contributor Author

Thanks!

Thank you for merging 🚀

@bb
Copy link
Contributor

bb commented May 16, 2024

I encountered the same issue today and can confirm that this PR fixes it. Thank you @gehrisandro!
Looking forward to the release. 😊

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

Successfully merging this pull request may close these issues.

4 participants