-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add a mobile minimum size for form fields #13639
Conversation
This implements our min-font size of 16px for form fields, in order to prevent zoom-in when Safari focuses on the fields.
This should fall back to the default, with the new minimum mobile font size.
Yes, thank you @kjellr ! Based on the videos above it looks right to my eyes, but wouldn't hurt to get other reviewers. Well done! 👏 |
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.
This code looks good to me but I haven't tested 👍
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.
Works great I tested on a real device I was able to replicate the zoom issue on master, and on this PR the problem is fixed.
No noticeable changes happened while testing on the desktop.
…rnmobile/372-use-RichText-on-Title-block * 'master' of https://github.com/WordPress/gutenberg: (22 commits) Make the modal title styling consistent (#13669) Disable navigation block for text mode. (#12185) Fix: Linting problem in modal example code (#13671) Add myself as a code owner to the annotations (#13672) Add more reviewers to CODEOWNERS.md file (#13667) Plugin: Remove jQuery heartbeat-to-hooks proxying (#13576) Workflow: Add repository CODEOWNERS file (#13604) Add a mobile minimum size for form fields (#13639) Update edit-save documentation (#13578) Alt image setting (#13631) Fix: Allow years lower than 1970 in DateTime component. (#13602) Using addQueryArgs to generate Manage All Reusable Blocks link (#13653) Bump plugin version to 5.0.0-rc.1 (#13652) Update lodash to 4.17.10 (#13651) Refreshed PR (#9469) Set default values of the width and height input fields according to the actual image dimensions (#7687) 12647 fix css color picker (#12747) Remove "we" from messages (#13644) Fix: Font size picker max width on mobile (#13264) Fix/issue 12501 menu item aria label ...
On Safari for iOS, the browser automatically zooms into any form field that contains text with a font size less than `16px`. When this occurs, users must manually zoom back out after dismissing the keyboard. This happens frequently in our interface, since many of our text fields use `13px` text. It breaks up the flow, and makes editing feel _very_ non-mobile-optimized. We already have a [`$mobile-text-min-font-size` variable](https://github.com/WordPress/gutenberg/blob/286317c8e61b1a2922243875fe1f98c868d7859b/assets/stylesheets/_variables.scss#L15), and use this to avoid this behavior in the block inserter: https://github.com/WordPress/gutenberg/blob/ce864a6f9aff4eea9b4bd3994b2cf4bae30105cb/packages/editor/src/components/inserter/style.scss#L75-L79 This PR expands that fix out to as many different form fields as I could find: - General form fields, defined in `/edit-post/` (this covers most fields by itself) - Preformatted, Code, and HTML blocks - Form Token Field (used in the tags panel of the document sidebar) - URL Input field⚠️ _This worked fine in my testing, but since it effects a lot of fields, it could use a lot of testing!_ In addition, the Code Editor extended off-screen on small screens. This PR adds a `max-width` to clean that up. ## Screenshots Before: 🎥 [**Screencast of the issue**](https://cloudup.com/cf1VqxNV5LN) ![ios-zoom-old](https://user-images.githubusercontent.com/1202812/52131756-93f03700-260b-11e9-83de-d03fb5a84a09.gif) <img width="376" alt="screen shot 2019-02-01 at 10 16 56 am" src="https://user-images.githubusercontent.com/1202812/52131610-2e03af80-260b-11e9-83d1-15c66590f62a.png"> After: 🎥 [**Screencast with this fix**](https://cloudup.com/cRQNYsDRsmx) ![ios-zoom](https://user-images.githubusercontent.com/1202812/52131874-f0535680-260b-11e9-9ad8-6ede81e21b60.gif) <img width="375" alt="screen shot 2019-02-01 at 10 02 16 am" src="https://user-images.githubusercontent.com/1202812/52131615-322fcd00-260b-11e9-88af-5407e32388ee.png"> --- cc @iamthomasbishop for some thoughts/testing too.
On Safari for iOS, the browser automatically zooms into any form field that contains text with a font size less than `16px`. When this occurs, users must manually zoom back out after dismissing the keyboard. This happens frequently in our interface, since many of our text fields use `13px` text. It breaks up the flow, and makes editing feel _very_ non-mobile-optimized. We already have a [`$mobile-text-min-font-size` variable](https://github.com/WordPress/gutenberg/blob/286317c8e61b1a2922243875fe1f98c868d7859b/assets/stylesheets/_variables.scss#L15), and use this to avoid this behavior in the block inserter: https://github.com/WordPress/gutenberg/blob/ce864a6f9aff4eea9b4bd3994b2cf4bae30105cb/packages/editor/src/components/inserter/style.scss#L75-L79 This PR expands that fix out to as many different form fields as I could find: - General form fields, defined in `/edit-post/` (this covers most fields by itself) - Preformatted, Code, and HTML blocks - Form Token Field (used in the tags panel of the document sidebar) - URL Input field⚠️ _This worked fine in my testing, but since it effects a lot of fields, it could use a lot of testing!_ In addition, the Code Editor extended off-screen on small screens. This PR adds a `max-width` to clean that up. ## Screenshots Before: 🎥 [**Screencast of the issue**](https://cloudup.com/cf1VqxNV5LN) ![ios-zoom-old](https://user-images.githubusercontent.com/1202812/52131756-93f03700-260b-11e9-83de-d03fb5a84a09.gif) <img width="376" alt="screen shot 2019-02-01 at 10 16 56 am" src="https://user-images.githubusercontent.com/1202812/52131610-2e03af80-260b-11e9-83d1-15c66590f62a.png"> After: 🎥 [**Screencast with this fix**](https://cloudup.com/cRQNYsDRsmx) ![ios-zoom](https://user-images.githubusercontent.com/1202812/52131874-f0535680-260b-11e9-9ad8-6ede81e21b60.gif) <img width="375" alt="screen shot 2019-02-01 at 10 02 16 am" src="https://user-images.githubusercontent.com/1202812/52131615-322fcd00-260b-11e9-88af-5407e32388ee.png"> --- cc @iamthomasbishop for some thoughts/testing too.
On Safari for iOS, the browser automatically zooms into any form field that contains text with a font size less than
16px
. When this occurs, users must manually zoom back out after dismissing the keyboard. This happens frequently in our interface, since many of our text fields use13px
text. It breaks up the flow, and makes editing feel very non-mobile-optimized.We already have a
$mobile-text-min-font-size
variable, and use this to avoid this behavior in the block inserter:gutenberg/packages/editor/src/components/inserter/style.scss
Lines 75 to 79 in ce864a6
This PR expands that fix out to as many different form fields as I could find:
/edit-post/
(this covers most fields by itself)In addition, the Code Editor extended off-screen on small screens. This PR adds a
max-width
to clean that up.Screenshots
Before:
🎥 Screencast of the issue
After:
🎥 Screencast with this fix
cc @iamthomasbishop for some thoughts/testing too.