Skip to content
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

[Grow] Extend Safari CSS transition bug workaround on WebKit browsers #32202

Merged
merged 1 commit into from
Apr 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions packages/mui-material/src/Grow/Grow.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ const styles = {
};

/**
* Conditionally apply a workaround for the CSS transition bug in Safari 15.4.
* Remove this workaround once the Safari bug is fixed.
* Conditionally apply a workaround for the CSS transition bug in Safari 15.4 / WebKit browsers.
* Remove this workaround once the WebKit bug fix is released.
*/
const isSafari154 =
const isWebKit154 =
typeof navigator !== 'undefined' &&
/^((?!chrome|android).)*safari/i.test(navigator.userAgent) &&
/version\/15\.[4-9]/i.test(navigator.userAgent);
/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent) &&
/(os |version\/)15(.|_)[4-9]/i.test(navigator.userAgent);

/**
* The Grow transition is used by the [Tooltip](/material-ui/react-tooltip/) and
Expand Down Expand Up @@ -105,7 +105,7 @@ const Grow = React.forwardRef(function Grow(props, ref) {
delay,
}),
theme.transitions.create('transform', {
duration: isSafari154 ? duration : duration * 0.666,
duration: isWebKit154 ? duration : duration * 0.666,
delay,
easing: transitionTimingFunction,
}),
Expand Down Expand Up @@ -146,8 +146,8 @@ const Grow = React.forwardRef(function Grow(props, ref) {
delay,
}),
theme.transitions.create('transform', {
duration: isSafari154 ? duration : duration * 0.666,
delay: isSafari154 ? delay : delay || duration * 0.333,
duration: isWebKit154 ? duration : duration * 0.666,
delay: isWebKit154 ? delay : delay || duration * 0.333,
easing: transitionTimingFunction,
}),
].join(',');
Expand Down