diff --git a/.changeset/spotty-zebras-sip.md b/.changeset/spotty-zebras-sip.md new file mode 100644 index 000000000..dc1dbdabf --- /dev/null +++ b/.changeset/spotty-zebras-sip.md @@ -0,0 +1,6 @@ +--- +'@lion/core': minor +'@lion/listbox': minor +--- + +Remove closestPolyfill diff --git a/packages/core/closestPolyfill.js b/packages/core/closestPolyfill.js deleted file mode 100644 index b0cdc02d6..000000000 --- a/packages/core/closestPolyfill.js +++ /dev/null @@ -1 +0,0 @@ -import './src/closestPolyfill.js'; diff --git a/packages/core/package.json b/packages/core/package.json index ad7b59ff7..f10eb8ed1 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -30,9 +30,7 @@ "prepublishOnly": "npm run publish-docs", "test": "cd ../../ && npm run test:browser -- --group core" }, - "sideEffects": [ - "./closestPolyfill.js" - ], + "sideEffects": false, "dependencies": { "@open-wc/dedupe-mixin": "^1.3.0", "@open-wc/scoped-elements": "^2.0.1", @@ -47,7 +45,6 @@ }, "exports": { ".": "./index.js", - "./closestPolyfill": "./src/closestPolyfill.js", "./docs/*": "./docs/*" } } diff --git a/packages/core/src/closestPolyfill.js b/packages/core/src/closestPolyfill.js deleted file mode 100644 index 0835a7133..000000000 --- a/packages/core/src/closestPolyfill.js +++ /dev/null @@ -1,23 +0,0 @@ -// @ts-nocheck -/* eslint-disable */ - -/** - * From: https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill - */ - -if (!Element.prototype.matches) { - Element.prototype.matches = - Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; -} - -if (!Element.prototype.closest) { - Element.prototype.closest = function (s) { - var el = this; - - do { - if (Element.prototype.matches.call(el, s)) return el; - el = el.parentElement || el.parentNode; - } while (el !== null && el.nodeType === 1); - return null; - }; -} diff --git a/packages/listbox/src/ListboxMixin.js b/packages/listbox/src/ListboxMixin.js index 68441b932..69e2d11fb 100644 --- a/packages/listbox/src/ListboxMixin.js +++ b/packages/listbox/src/ListboxMixin.js @@ -1,5 +1,4 @@ import { css, dedupeMixin, html, ScopedElementsMixin, SlotMixin } from '@lion/core'; -import '@lion/core/closestPolyfill'; import { ChoiceGroupMixin, FormControlMixin, FormRegistrarMixin } from '@lion/form-core'; import { LionOptions } from './LionOptions.js';