kutlugsahin / smooth-dnd

drag and drop library for javascript
MIT License
599 stars 147 forks source link

remove global.Node `matches` polyfill #29

Open NoMaillard opened 5 years ago

NoMaillard commented 5 years ago

matches is not a method on a Node only on an Element

rahim commented 4 years ago

It would be great to see this merged - I've just hit exactly this issue, where a third party script (from VWO) has been throwing errors because it assumes matches would be defined on Element, but not Node (or Document which is a descendant) matching the DOM specs:

smooth-dnd itself uses matches only once (here) and the TypeScript implies it's only ever used on Element so the change should be safe.