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

fix: useMediaQueries support on Safari and IE11 #262

Merged
merged 1 commit into from
Jul 15, 2020

Conversation

tassoevan
Copy link
Collaborator

As seen in https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/addListener:

This is basically an alias for EventTarget.addEventListener(), for backwards compatibility purposes. Older browsers should use addListener instead of addEventListener since MediaQueryList only inherits from EventTarget in newer browsers.

MediaQueryList don't inherits from EventTarget in Safari and IE11. This PR fallbacks to addListener/removeListener when addEventListener/removeEventListener aren't present.

@tassoevan tassoevan added 🐛 Bug Something isn't working 📦 fuselage-hooks labels Jul 15, 2020
@tassoevan tassoevan requested a review from a team July 15, 2020 06:17
@ggazzo ggazzo merged commit f7be49a into develop Jul 15, 2020
@ggazzo ggazzo deleted the fix/use-media-queries-backward-compat branch July 15, 2020 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working 📦 fuselage-hooks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants