-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: Height of modal underlay is incorrect when the body has height: 100% #8958
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
Conversation
let scrollingElement = isScrollable(document.body) ? document.body : document.scrollingElement || document.documentElement; | ||
// Prevent Firefox from adding scrollbars when the page has a fractional height. | ||
let fractionalHeightDifference = scrollingElement.clientHeight - scrollingElement.getBoundingClientRect().height; | ||
pageHeight = scrollingElement.scrollHeight - fractionalHeightDifference; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's another way to get the scrollHeight but not rounded?
Build successful! 🎉 |
This reverts commit 5420894.
Build successful! 🎉 |
This reverts commit 21740c3.
grabbing a build for the apps with the last couple of changes just in case |
This reverts commit 42cb451.
Build successful! 🎉 |
https://www.chromatic.com/build?appId=5f0dd5ad2b5fc10022a2e320&number=1051 |
Found a bug that occurs in our CRA example app, where the body has
height: 100%
. If you open a modal, the underlay is not visible. We need to use thescrollHeight
instead of theclientHeight
/ bounding client rect.Test instructions: