reakit-utils
Version:
Reakit utils
23 lines (17 loc) • 495 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
/**
* Ponyfill for `Element.prototype.matches`
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
*/
function matches(element, selectors) {
if ("matches" in element) {
return element.matches(selectors);
}
if ("msMatchesSelector" in element) {
return element.msMatchesSelector(selectors);
}
return element.webkitMatchesSelector(selectors);
}
exports.matches = matches;