terra-data-grid
Version:
Package containing data grid container components that enable users to navigate the grid information using directional navigation keys.
19 lines (18 loc) • 647 B
JavaScript
;
// Source: https://www.npmjs.com/package/element-closest-polyfill
// Needed for IE support since consuming team still needs to support IE.
if (typeof Element !== 'undefined') {
if (!Element.prototype.matches) {
Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
}
if (!Element.prototype.closest) {
Element.prototype.closest = function closest(selector) {
var el = this;
do {
if (el.matches(selector)) return el;
el = el.parentElement || el.parentNode;
} while (el !== null && el.nodeType === 1);
return null;
};
}
}