-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 workaround for font-optical-sizing
issue in Safari 16
#11503
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@shopify/polaris': patch | ||
--- | ||
|
||
Added workaround for `font-optical-sizing` issue in Safari 16 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,6 +108,19 @@ export class AppProvider extends Component<AppProviderProps, State> { | |
this.stickyManager.setContainer(document); | ||
this.setBodyStyles(); | ||
this.setRootAttributes(); | ||
|
||
const isSafari16 = | ||
navigator.userAgent.includes('Safari') && | ||
!navigator.userAgent.includes('Chrome') && | ||
(navigator.userAgent.includes('Version/16.1') || | ||
navigator.userAgent.includes('Version/16.2') || | ||
navigator.userAgent.includes('Version/16.3')); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assume this is fixed in Safari 16.4 and above? If so, this is fine with me for now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, to my understanding 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reference links:
|
||
|
||
if (isSafari16) { | ||
document.documentElement.classList.add( | ||
'Polaris-Safari-16-Font-Optical-Sizing-Patch', | ||
); | ||
} | ||
} | ||
measureScrollbars(); | ||
} | ||
|
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.
Is there not a v16.0?
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.
The issue started in v16.1