Skip to content

Commit

Permalink
fix: iOS 16 font patch for web views (#11725)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyledurand authored Mar 13, 2024
1 parent c3ba6ae commit 3e011e3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/lemon-ties-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': patch
---

Fixed a bug where iOS 16 font patch wasn't added for mobile app web views
8 changes: 7 additions & 1 deletion polaris-react/src/components/AppProvider/AppProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,13 @@ export class AppProvider extends Component<AppProviderProps, State> {
navigator.userAgent.includes('Version/16.2') ||
navigator.userAgent.includes('Version/16.3'));

if (isSafari16) {
const isMobileApp16 =
navigator.userAgent.includes('Shopify Mobile/iOS') &&
(navigator.userAgent.includes('OS 16_1') ||
navigator.userAgent.includes('OS 16_2') ||
navigator.userAgent.includes('OS 16_3'));

if (isSafari16 || isMobileApp16) {
document.documentElement.classList.add(
'Polaris-Safari-16-Font-Optical-Sizing-Patch',
);
Expand Down

0 comments on commit 3e011e3

Please sign in to comment.