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
📊 Bundle size reportUnchanged fixtures
|
|
Pull request demo site: URL |
| @@ -0,0 +1,7 @@ | |||
| { | |||
There was a problem hiding this comment.
🕵🏾♀️ visual changes to review in the Visual Change Report
vr-tests-react-components/Avatar Converged 2 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Avatar Converged.badgeMask - RTL.normal.chromium.png | 6 | Changed |
| vr-tests-react-components/Avatar Converged.badgeMask.normal.chromium.png | 4 | Changed |
vr-tests-react-components/CalendarCompat 5 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/CalendarCompat.multiDayView.default.chromium_1.png | 2704 | Changed |
| vr-tests-react-components/CalendarCompat.multiDayView.default.chromium.png | 2434 | Changed |
| vr-tests-react-components/CalendarCompat.multiDayView - Dark Mode.default.chromium.png | 6713 | Changed |
| vr-tests-react-components/CalendarCompat.multiDayView - High Contrast.default.chromium.png | 7264 | Changed |
| vr-tests-react-components/CalendarCompat.multiDayView - RTL.default.chromium.png | 2323 | Changed |
vr-tests-react-components/Charts-DonutChart 6 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Charts-DonutChart.Basic - Dark Mode.default.chromium.png | 8845 | Changed |
| vr-tests-react-components/Charts-DonutChart.Basic - RTL.default.chromium.png | 9673 | Changed |
| vr-tests-react-components/Charts-DonutChart.Basic.default.chromium.png | 9673 | Changed |
| vr-tests-react-components/Charts-DonutChart.Dynamic.default.chromium.png | 10891 | Changed |
| vr-tests-react-components/Charts-DonutChart.Dynamic - RTL.default.chromium.png | 10891 | Changed |
| vr-tests-react-components/Charts-DonutChart.Dynamic - Dark Mode.default.chromium.png | 12504 | Changed |
vr-tests-react-components/DatePicker Compat 3 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/DatePicker Compat.default - Dark Mode.rest.chromium.png | 371 | Changed |
| vr-tests-react-components/DatePicker Compat.default - High Contrast.opened.chromium.png | 443 | Changed |
| vr-tests-react-components/DatePicker Compat.default.rest.chromium.png | 311 | Changed |
vr-tests-react-components/Field 8 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Field.Checkbox.default.chromium.png | 13 | Changed |
| vr-tests-react-components/Field.ProgressBar.default.chromium.png | 13 | Changed |
| vr-tests-react-components/Field.RadioGroup.default.chromium.png | 13 | Changed |
| vr-tests-react-components/Field.Slider.default.chromium.png | 13 | Changed |
| vr-tests-react-components/Field.SpinButton.default.chromium.png | 13 | Changed |
| vr-tests-react-components/Field.Switch.default.chromium.png | 13 | Changed |
| vr-tests-react-components/Field.validation-error.default.chromium.png | 13 | Changed |
| vr-tests-react-components/Field.Textarea.default.chromium.png | 13 | Changed |
vr-tests-react-components/Menu Converged - submenuIndicator slotted content 2 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default - RTL.submenus open.chromium.png | 416 | Changed |
| vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default.submenus open.chromium.png | 619 | Changed |
vr-tests-react-components/MessageBar 8 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/MessageBar.Auto.default.chromium.png | 17 | Changed |
| vr-tests-react-components/MessageBar.Intents - Dark Mode.default.chromium.png | 66 | Changed |
| vr-tests-react-components/MessageBar.Intents - High Contrast.default.chromium.png | 134 | Changed |
| vr-tests-react-components/MessageBar.Square.default.chromium.png | 17 | Changed |
| vr-tests-react-components/MessageBar.Multiline Without Actions.default.chromium.png | 98 | Changed |
| vr-tests-react-components/MessageBar.Intents.default.chromium.png | 98 | Changed |
| vr-tests-react-components/MessageBar.Multiline No Actions.default.chromium.png | 98 | Changed |
| vr-tests-react-components/MessageBar.Multiline.default.chromium.png | 98 | Changed |
vr-tests-react-components/Popover Converged 1 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Popover Converged.when rendering inline, it should not render behind relatively positioned elements.PopoverSurface focused.chromium.png | 93 | Changed |
vr-tests-react-components/Positioning 2 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png | 497 | Changed |
| vr-tests-react-components/Positioning.Positioning end.chromium.png | 54 | Changed |
vr-tests-react-components/ProgressBar converged 4 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - Dark Mode.default.chromium.png | 208 | Changed |
| vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - High Contrast.default.chromium.png | 404 | Changed |
| vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - RTL.default.chromium.png | 162 | Changed |
| vr-tests-react-components/ProgressBar converged.Indeterminate + thickness.default.chromium.png | 326 | Changed |
vr-tests-react-components/TagPicker 1 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/TagPicker.disabled - Dark Mode.disabled input hover.chromium.png | 658 | Changed |
vr-tests-react-components/Toast 9 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Toast.Full Toast Inverted.Toast visible.chromium.png | 8 | Changed |
| vr-tests-react-components/Toast.Full Toast Inverted - Dark Mode.Toast visible.chromium.png | 16 | Changed |
| vr-tests-react-components/Toast.Full Toast Inverted - High Contrast.Toast visible.chromium.png | 21 | Changed |
| vr-tests-react-components/Toast.Title Only Inverted - High Contrast.Toast visible.chromium.png | 21 | Changed |
| vr-tests-react-components/Toast.Title Only Inverted.Toast visible.chromium.png | 8 | Changed |
| vr-tests-react-components/Toast.Title Only.Toast visible.chromium.png | 16 | Changed |
| vr-tests-react-components/Toast.Without Subtitle Inverted - High Contrast.Toast visible.chromium.png | 21 | Changed |
| vr-tests-react-components/Toast.Without Subtitle - RTL.Toast visible.chromium.png | 16 | Changed |
| vr-tests-react-components/Toast.Without Subtitle Inverted.Toast visible.chromium.png | 8 | Changed |
vr-tests-react-components/Toolbar Converged 12 screenshots
| Image Name | Diff(in Pixels) | Image Type |
|---|---|---|
| vr-tests-react-components/Toolbar Converged.Far Group.Button Pressed.chromium.png | 11 | Changed |
| vr-tests-react-components/Toolbar Converged.Far Group.Toggle On.chromium.png | 20 | Changed |
| vr-tests-react-components/Toolbar Converged.Far Group.default.chromium.png | 29 | Changed |
| vr-tests-react-components/Toolbar Converged.Large.Button Pressed.chromium.png | 5273 | Changed |
| vr-tests-react-components/Toolbar Converged.Large.Toggle On.chromium.png | 5209 | Changed |
| vr-tests-react-components/Toolbar Converged.Large.default.chromium.png | 5245 | Changed |
| vr-tests-react-components/Toolbar Converged.Small.Button Pressed.chromium.png | 109 | Changed |
| vr-tests-react-components/Toolbar Converged.Small.Toggle On.chromium.png | 92 | Changed |
| vr-tests-react-components/Toolbar Converged.Small.default.chromium.png | 110 | Changed |
| vr-tests-react-components/Toolbar Converged.Vertical.Button Pressed.chromium.png | 11 | Changed |
| vr-tests-react-components/Toolbar Converged.Vertical.Toggle On.chromium.png | 20 | Changed |
| vr-tests-react-components/Toolbar Converged.Vertical.default.chromium.png | 29 | Changed |
There were 23 duplicate changes discarded. Check the build logs for more information.
Contributor
|
Paul Mardling (@PaulGMardling) could you please verify the fix and if everything works as expected merge the PR? Thanks! |
Author
|
Ok sure
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
|
Contributor
Dmytro Kirpa (@dmytrokirpa) I verified it, but Victor Genaev (@mainframev) is the code owner |
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)