mq-polyfill icon indicating copy to clipboard operation
mq-polyfill copied to clipboard

Missing Support for addEventListener/removeEventListener

Open DaleSeo opened this issue 4 years ago • 2 comments

The addListener and removeListener methods of MediaQueryList are deprecated and using them now causes linting errors as seen below.

image

I'd like to request adding support for the addEventListener and removeEventListener methods so that they can be used instead as recommended on MDN.

This method exists primarily for backward compatibility; if possible, you should instead use addEventListener() to watch for the change event.

https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList

DaleSeo avatar Nov 11 '20 12:11 DaleSeo

I just ran into the same issue. If it's alright with @bigslycat I can open a PR with support.

TatisLois avatar Feb 26 '21 22:02 TatisLois

@bigslycat @fuller going to work on a PR to update the lib.

TatisLois avatar Apr 01 '21 03:04 TatisLois