You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Safari 5.0 doesn't have addEventListener method so the prefersReducedMotionStore cause the app to break on macOs < 10.16.
As a work around I added a script tag in the app.html that contains this polyfill : // MediaQueryList not available globally on Safari 5.0 if (!window.matchMedia('(prefers-reduce-motion: reduce)').addEventListener) { function polyfillEventListener(mediaQueryList, eventName, listener) { if (mediaQueryList.addListener) { mediaQueryList.addListener(listener); } } // MediaQueryList still not available globally ... sigh var matchMediaInstance = window.matchMedia('(prefers-reduce-motion: reduce)'); matchMediaInstance.constructor.prototype.addEventListener = function(eventName, listener) { polyfillEventListener(this, eventName, listener); } } // ... then do the same for removeEventListner
If you have any suggestion that can enhance this piece of code, that'd be great :)
I hope it helps !
The text was updated successfully, but these errors were encountered:
Safari 5.0 doesn't have addEventListener method so the prefersReducedMotionStore cause the app to break on macOs < 10.16.
As a work around I added a script tag in the app.html that contains this polyfill :
// MediaQueryList not available globally on Safari 5.0 if (!window.matchMedia('(prefers-reduce-motion: reduce)').addEventListener) { function polyfillEventListener(mediaQueryList, eventName, listener) { if (mediaQueryList.addListener) { mediaQueryList.addListener(listener); } } // MediaQueryList still not available globally ... sigh var matchMediaInstance = window.matchMedia('(prefers-reduce-motion: reduce)'); matchMediaInstance.constructor.prototype.addEventListener = function(eventName, listener) { polyfillEventListener(this, eventName, listener); } } // ... then do the same for removeEventListner
If you have any suggestion that can enhance this piece of code, that'd be great :)
I hope it helps !
The text was updated successfully, but these errors were encountered: