fix(react-drawer): report bottom scroll state at fractional browser zoom - #36677
Open
Frank Nambeh (Frank20021) wants to merge 1 commit into
Open
Conversation
`getScrollState` compared scroll offsets for exact equality, but browsers round `clientHeight` and `scrollHeight` to integers while `scrollTop` stays fractional. At non-integer browser zoom a fully scrolled DrawerBody therefore reported `middle` instead of `bottom`, which kept the divider above NavDrawerFooter visible. The same rounding can make a non-scrollable body report a pixel of overflow it cannot actually scroll, reporting `top` and showing the divider on a drawer with nothing to scroll. Compare both with a tolerance instead. Measured against Chromium across 31 zoom levels from 100% to 250%, the bottom offset falls up to 1.44px short of the computed maximum, and phantom overflow is at most 1px. Behaviour at 100% zoom is unchanged. Fixes microsoft#36331 Co-authored-by: Cursor <cursoragent@cursor.com>
Frank Nambeh (Frank20021)
requested review from
a team and
Victor Genaev (mainframev)
as code owners
September 1, 2026 20:29
Dmytro Kirpa (dmytrokirpa)
requested a review
from Paul Mardling (PaulGMardling)
September 2, 2026 18:27
Author
|
@microsoft-github-policy-service agree |
Paul Mardling (PaulGMardling)
approved these changes
Sep 3, 2026
Paul Mardling (PaulGMardling)
left a comment
Contributor
There was a problem hiding this comment.
This is the more complete fix: the tolerances are backed by measured fractional-zoom behavior, it also handles phantom 1px overflow, and it includes regression coverage.
This was referenced Sep 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
getScrollStatecompared scroll offsets for exact equality, but browsers roundclientHeightandscrollHeightto integers whilescrollTopstays fractional. At non-integer browser zoom a fully scrolled DrawerBody therefore reportedmiddleinstead ofbottom, which kept the divider above NavDrawerFooter visible. The same rounding can make a non-scrollable body report a pixel of overflow it cannot actually scroll, reportingtopand showing the divider on a drawer with nothing to scroll.Compare both with a tolerance instead. Measured against Chromium across 31 zoom levels from 100% to 250%, the bottom offset falls up to 1.44px short of the computed maximum, and phantom overflow is at most 1px. Behaviour at 100% zoom is unchanged.
Fixes #36331
Previous Behavior
New Behavior
Related Issue(s)