Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.

Conversation

chloerice
Copy link
Member

@chloerice chloerice commented Apr 12, 2024

WHY are these changes introduced?

TextField was accidently migrated to having font-size of 13px on all screen sizes, causing mobile browsers to zoom to enlarge the input on focus.

WHAT is this PR doing?

This PR reverts the regression of TextField and Select mobile font styles back to 16px below the medium breakpoint. I also fixed the zoom on the Picker SearchField, but refrained from increasing the size of the selected item's text in the Activator as I know it's WIP and I'm not sure if the small mobile font-size is intentional (@kyledurand @tjonx).

Before After
TextField-mobile-zoom-regression--before.MP4
TextField-mobile-zoom-regression--after.MP4

How to 🎩

🌀 Spinstance
🎭 Staging: ayij

  • Navigate to the Storybook links in the "After" column of the table above (on a real mobile device or on a mobile device in Browserstack) to verify TextField and Select are 16px and behave as expected
    • Browser should not zoom when TextField or Picker SearchField are focused
    • Select should be the correct font size as well
  • Spin and staging are provided to verify that inputs remain 13px on your desktop sized device

🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines

🎩 checklist

@chloerice

This comment was marked as outdated.

This comment was marked as outdated.

@chloerice chloerice force-pushed the fix-input-font-size-on-mobile branch 3 times, most recently from ba23dd8 to 62fd1dd Compare April 12, 2024 20:31
@chloerice chloerice changed the title [TextField] Fix zoom on focus due to font-size below 16px [TextField][Select] Fix mobile zoom due to font-size Apr 12, 2024
@chloerice chloerice force-pushed the fix-input-font-size-on-mobile branch from 62fd1dd to a9019ec Compare April 12, 2024 20:46
@chloerice
Copy link
Member Author

/snapit

Copy link
Contributor

🫰✨ Thanks @chloerice! Your snapshothas been published to npm.

Test the snapshot by updating your package.json with the newly published version:

"@shopify/polaris": "0.0.0-snapshot-20240412220833"

@chloerice chloerice force-pushed the fix-input-font-size-on-mobile branch from a9019ec to 52387d1 Compare April 12, 2024 22:22
@chloerice chloerice added Bug Something is broken and not working as intended in the system. Component labels Apr 12, 2024
@chloerice chloerice changed the title [TextField][Select] Fix mobile zoom due to font-size [TextField][Select][PickerSearchField] Fix mobile zoom due to font-size Apr 12, 2024
@chloerice chloerice merged commit 3740304 into main Apr 12, 2024
@chloerice chloerice deleted the fix-input-font-size-on-mobile branch April 12, 2024 23:45
sophschneider pushed a commit that referenced this pull request Apr 17, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @shopify/polaris@13.1.0

### Minor Changes

- [#11883](#11883)
[`a60d8aa4f`](a60d8aa)
Thanks [@chloerice](https://github.com/chloerice)! - Added a
`disclosureZIndexOverride` prop to `Filters`, `IndexFilters`, and `Tabs`
that is passed to `Popover` and `Tooltip` when provided


- [#11826](#11826)
[`a7fd7ab5d`](a7fd7ab)
Thanks [@sophschneider](https://github.com/sophschneider)! - Added
`contextualSaveBarVisible` and `contextualSaveBarProps` to `Frame`
context

### Patch Changes

- [#11842](#11842)
[`2a93578af`](2a93578)
Thanks [@kyledurand](https://github.com/kyledurand)! - Fixed layout
shift for option lists within popovers


- [#11846](#11846)
[`ce6353b97`](ce6353b)
Thanks [@sophschneider](https://github.com/sophschneider)! - Restyled
Frame content behind dynamicTopBarAndReframe feature flag


- [#11872](#11872)
[`696bcb725`](696bcb7)
Thanks [@mattkubej](https://github.com/mattkubej)! - globally remove
link tap highlighting


- [#11874](#11874)
[`744036706`](7440367)
Thanks [@laurkim](https://github.com/laurkim)! - Added support for ref
to `Image` to handle image load with `EmptyState`


- [#11881](#11881)
[`c96ff56a0`](c96ff56)
Thanks [@sophschneider](https://github.com/sophschneider)! - Fixed Frame
feature override class to get proper max-width for main content.


- [#11885](#11885)
[`af80d3a82`](af80d3a)
Thanks [@craigcolesshopify](https://github.com/craigcolesshopify)! -
[indexTable] Fixed over scroll gap on `IndexTable` for sortable last
headings with `alignment="end"`


- [#11889](#11889)
[`374030428`](3740304)
Thanks [@chloerice](https://github.com/chloerice)! - Fixed `TextField`
zoom on focus due to font-size below 16px


- [#11900](#11900)
[`215b79271`](215b792)
Thanks [@sophschneider](https://github.com/sophschneider)! - Fixed
`Frame` scrollbar safe area to accommodate sidebar


- [#11842](#11842)
[`2a93578af`](2a93578)
Thanks [@kyledurand](https://github.com/kyledurand)! - Changed selected
icon position in Listbox and OptionList


- [#11891](#11891)
[`c84d4e875`](c84d4e8)
Thanks [@sophschneider](https://github.com/sophschneider)! - Moved
`Frame` scrollbar from main to content and set overflow-y from scroll to
auto behind a feature flag

## polaris.shopify.com@1.0.1

### Patch Changes

- Updated dependencies
\[[`a60d8aa4f`](a60d8aa),
[`2a93578af`](2a93578),
[`ce6353b97`](ce6353b),
[`696bcb725`](696bcb7),
[`744036706`](7440367),
[`c96ff56a0`](c96ff56),
[`af80d3a82`](af80d3a),
[`374030428`](3740304),
[`215b79271`](215b792),
[`a7fd7ab5d`](a7fd7ab),
[`2a93578af`](2a93578),
[`c84d4e875`](c84d4e8)]:
    -   @shopify/polaris@13.1.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
AnnaCheba pushed a commit to AnnaCheba/polaris that referenced this pull request Apr 22, 2024
…ze (Shopify#11889)

### WHY are these changes introduced?

`TextField` was [accidently
migrated](Shopify#11833) to having
font-size of 13px on all screen sizes, causing mobile browsers to zoom
to enlarge the input on focus.

### WHAT is this PR doing?

This PR reverts the regression of `TextField` and `Select` mobile font
styles back to 16px below the medium breakpoint. I also fixed the zoom
on the Picker SearchField, but refrained from increasing the size of the
selected item's text in the Activator as I know it's WIP and I'm not
sure if the small mobile font-size is intentional (@kyledurand @tjonx).

|
[Before](https://storybook.polaris.shopify.com/?path=/story/playground--details-page)
| [After](https://5d559397bae39100201eedc1-axbsaknzmj.chromatic.com/) |
|--------|--------|
| <video controls
src="https://github.com/Shopify/polaris/assets/18447883/18a12572-45e3-4f3e-a93e-9e45636617ae"
alt="Video demonstrating browser zoom on input focus" />| <video
controls
src="https://github.com/Shopify/polaris/assets/18447883/7e03f5bc-5a7b-41af-97d8-42ee5303353b"
/> |

### How to 🎩

🌀
[Spinstance](https://admin.web.mobile-input-font-size.chloe-rice.us.spin.dev/store/shop1/products/1)
🎭 Staging: `ayij` 

- Navigate to the Storybook links in the "After" column of the table
above (on a real mobile device or on a mobile device in Browserstack) to
verify TextField and Select are 16px and behave as expected
- Browser should not zoom when TextField or Picker SearchField are
focused
  - Select should be the correct font size as well  
- Spin and staging are provided to verify that inputs remain 13px on
your desktop sized device

🖥 [Local development
instructions](https://github.com/Shopify/polaris/blob/main/README.md#install-dependencies-and-build-workspaces)
🗒 [General tophatting
guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md)
📄 [Changelog
guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog)

### 🎩 checklist

- [x] Tested a
[snapshot](https://github.com/Shopify/polaris/blob/main/documentation/Releasing.md#-snapshot-releases)
- [x] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [x] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [x] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- [ ] Updated the component's `README.md` with documentation changes
- [ ] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something is broken and not working as intended in the system. Component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants