We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
First up, thanks for making this package!
I've discovered that it doesn't work in Safari 13 (and probably below): [Error] TypeError: mq.addEventListener is not a function.
[Error] TypeError: mq.addEventListener is not a function.
Safari 13 uses an older, outdated syntax: mq.addListener(handleChange); Whereas modern browsers use the later spec mq.addEventListener('change', handleChange); (https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/addListener)
mq.addListener(handleChange);
mq.addEventListener('change', handleChange);
You could give this a shot instead (although I haven't tested it):
try { mq.addEventListener('change', handleChange); } catch (err) { // Safari mq.addListener(handleChange); }
The text was updated successfully, but these errors were encountered:
if (mq.addListener) { mq.addListener(handleChange); } else { mq.addEventListener('change', handleChange); }
Sorry, something went wrong.
I'm getting a similar looking issue with Internet Explorer 11
Object doesn't support property or method 'addEventListener'
Can confirm that this PR will fix the issue as I have tested it locally and IE stops breaking
Successfully merging a pull request may close this issue.
First up, thanks for making this package!
I've discovered that it doesn't work in Safari 13 (and probably below):
[Error] TypeError: mq.addEventListener is not a function.
Safari 13 uses an older, outdated syntax:
mq.addListener(handleChange);
Whereas modern browsers use the later spec
mq.addEventListener('change', handleChange);
(https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/addListener)
You could give this a shot instead (although I haven't tested it):
The text was updated successfully, but these errors were encountered: