-
Notifications
You must be signed in to change notification settings - Fork 289
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
Missing Support for addEventListener/removeEventListener #86
Comments
spec text here: https://drafts.csswg.org/cssom-view/#dom-mediaquerylist-addlistener it looks like this is not technically deprecated, but it's just the old n busted legacy way of doing things. now the MQList implements EventTarget so yeah, using that with the |
i started implementing this.. but... backing up.. matchMedia has been implemented in browsers for years. I can't see why you'd need a polyfill for it. addEventListener support is everywhere too. it was added recently in safari 14 but i imagine that's already well distributed enough that you don't need to polyfill this either.. (basically it seems more sensible to just deprecate this polyfill and say it's no longer needed... wdyt?) |
@paulirish Thanks a lot for looking at this. I needed a polyfill for matchMedia to write server-side unit tests (using Jest) for a React component that makes use of matchMedia. |
Hi @paulirish Same situation as @DaleSeo, until JSDom adds |
The
addListener
andremoveListener
methods ofMediaQueryList
are deprecated and using them now causes linting errors as seen below.I'd like to request adding support for the
addEventListener
andremoveEventListener
methods so that they can be used instead as recommended on MDN.https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList
The text was updated successfully, but these errors were encountered: