Fix breakpoint detection on mobile with content overflow - #1450
Open
qroll wants to merge 2 commits into
Open
Conversation
qroll
force-pushed
the
fix-breakpoint-detection
branch
from
September 2, 2026 03:28
9ef6fc2 to
c1bcbb3
Compare
qroll
force-pushed
the
fix-breakpoint-detection
branch
from
September 2, 2026 03:33
c1bcbb3 to
64d819a
Compare
qroll
marked this pull request as ready for review
September 2, 2026 05:03
ghazwan-gt
approved these changes
Sep 2, 2026
| const width = window.innerWidth; | ||
|
|
||
| const width = window.visualViewport | ||
| ? window.visualViewport.width * window.visualViewport.scale |
Contributor
There was a problem hiding this comment.
Should we do Math.round instead here?
Contributor
Author
There was a problem hiding this comment.
do you mean to round the final value of width? or to round window.visualViewport?
Contributor
There was a problem hiding this comment.
I mean for the calculation result
Math.round(window.visualViewport.width * window.visualViewport.scale)
Just in case the value has fractional result e.g. x.999, could cause a 1px mismatch
Contributor
Author
There was a problem hiding this comment.
got it, let me look into the rounding behaviour of media queries to remain consistent with our javascript checks
Contributor
Author
Contributor
Author
There was a problem hiding this comment.
perhaps switching over to use window.matchMedia would give us more consistent results
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.




Type of changes
Description of changes
window.innerWidth, which could grow beyond the visible viewport when there is overflow content (without overflow hidden)fds-breakpoint-mdChecklist
Looks good on mobile and tabletUpdated documentationAdded/updated unit tests- can't be verified in unit tests