Repository navigation
Fix horizontal scroll on iPhone: let form controls shrink in grid/flex cells - #10
Merged
Merged
Conversation
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.
Problem
On iPhone the page still scrolled sideways, with the right side cropped. iOS Safari sizes native
<select>and number<input>controls to fit their content (a dropdown is as wide as its longest option, e.g. ".308 Win / 7.62×51 NATO — .308″"). Grid and flex columns default tomin-width: auto, so they stretched to fit the control and pushed the card past the screen edge. Chromium and Linux WebKit don't size controls this way, so it didn't show up in desktop testing.Fix
input, select { min-width: 0; max-width: 100%; }.grid2/.grid3/.row/.gear-grid/.trowchildren getmin-width: 0, so columns shrink to their share of the card.select { text-overflow: ellipsis; }: long options are cut off with "…" in the closed dropdown; the full text still shows when opened.Verified
WebKit (Playwright) with iOS-like control sizes at 393px (iPhone 15 Pro): before the fix the caliber dropdown pushed the barrel-twist field to 390px, past the card's inner edge at about 363px. After the fix nothing overflows on any tab.
node test.js: 70 passed.