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

Correctly detect Safari in browser supports CSS Zoom #21163

Merged
merged 1 commit into from
Feb 20, 2023
Merged

Conversation

JReinhold
Copy link
Contributor

@JReinhold JReinhold commented Feb 20, 2023

#21138 introduced a bug, because the regex that was trying to detect Safari, also returned true for Chrome, which it shouldn't. This PR fixes that Regex.

See #21138 (comment)

What I did

How to test

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • If this PR should be tested against many or all sandboxes,
    make sure to add the ci:merged or ci:daily GH label to it.
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]

@JReinhold JReinhold requested a review from ndelangen February 20, 2023 14:06
@JReinhold JReinhold self-assigned this Feb 20, 2023
@JReinhold JReinhold mentioned this pull request Feb 20, 2023
5 tasks
@ndelangen ndelangen merged commit 648590f into next Feb 20, 2023
@ndelangen ndelangen deleted the fix-safari-zoom branch February 20, 2023 14:48
jrencz added a commit to jrencz/storybook that referenced this pull request Feb 20, 2023
Problem, as described in [this thread](storybookjs#21138 (review))
affects stories rendered with custom elements using Shadow DOM. Such
stories are affected if at the moment ZoomElement measures the height,
component did not yet render its contents. Then, when component in a
story renders content, it doesn't trigger MutationObserver (mutation
callback is not called when Shadow DOM is altered).

ResizeObserver is added next to MutationObserver (orignally added via
storybookjs#15472), not replaces it, because MutationObserver is better supported
by older browsers than ResizeObserver.

Problem, as described in the original thread was mitigated by @JReinhold
with storybookjs#21163, but even after that fix Safari is excluded from using native
`zoom` and needs the fallback behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants