-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
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):
try {
mq.addEventListener('change', handleChange);
} catch (err) {
// Safari
mq.addListener(handleChange);
}
jackharding and meotimdihia
Metadata
Metadata
Assignees
Labels
No labels