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

useReducedMotion: fix in Safari/Edge #1134

Merged

Conversation

christianvuerings
Copy link
Contributor

@christianvuerings christianvuerings commented Aug 7, 2020

addEventListener is not supported in Safari / Edge on the Media Query object

image

https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList#Methods mentions we should use addEventListener with the change event when possible. So we use that before trying addListener

image

Test Plan

  1. Open Safari
  2. Go to the useReducedMotion page
  3. Ensure there are no exceptions in the console

@christianvuerings christianvuerings requested a review from a team as a code owner August 7, 2020 19:32
@christianvuerings christianvuerings added the minor release Minor release label Aug 7, 2020
@netlify
Copy link

netlify bot commented Aug 7, 2020

Deploy preview for gestalt ready!

Built with commit 667a7b4

https://deploy-preview-1134--gestalt.netlify.app

Copy link
Contributor

@btraut btraut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks for the quick turnaround on this!

@christianvuerings christianvuerings merged commit 9867f32 into pinterest:master Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor release Minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants