diff --git a/package.json b/package.json index 7b42c3e..c72d8dd 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,8 @@ { "name": "@darkwiiplayer/better-select", - "module": "BetterSelect.js", - "type": "module" + "browser": "src/BetterSelect.js", + "type": "module", + "license": "MIT", + "version": "1.0.2", + "url": "https://darkwiiplayer.github.io/BetterSelect/" } diff --git a/src/BetterSelect.js b/src/BetterSelect.js index 28874db..a802a87 100644 --- a/src/BetterSelect.js +++ b/src/BetterSelect.js @@ -41,10 +41,13 @@ const css = template(string => { }) const childObserver = new MutationObserver(mutations => { - for (const mutation of mutations) { - if (mutation.target instanceof BetterSelect) - mutation.target.mutationCallback() + const targets = new Set() + for (const {target} of mutations) { + if (target instanceof BetterSelect) + targets.add(target) } + for (const target of targets) + target.mutationCallback() }) export class BetterSelect extends HTMLElement {