diff --git a/.changeset/stale-clocks-shake.md b/.changeset/stale-clocks-shake.md new file mode 100644 index 0000000..b684fbc --- /dev/null +++ b/.changeset/stale-clocks-shake.md @@ -0,0 +1,5 @@ +--- +'@chialab/quantum': patch +--- + +Fix `insertAdjacentElement` method. diff --git a/docs/index.md b/docs/index.md index 0ce0a0e..b6c0435 100644 --- a/docs/index.md +++ b/docs/index.md @@ -8,7 +8,7 @@ titleTemplate: Custom elements composition made easy hero: name: 'Quantum' text: '' - tagline: 'Custom elements composition made easy' + tagline: 'Custom elements composition made easy.' actions: - theme: brand text: npm i @chialab/quantum diff --git a/src/Element.js b/src/Element.js index 49dfb8f..17d9e68 100644 --- a/src/Element.js +++ b/src/Element.js @@ -223,7 +223,7 @@ export function extendElement(Element) { switch (position) { case 'beforebegin': if (!parentRealm) { - return /** @type {import('./utils.js').ValueDescriptor} */ (insertAdjacentElement).value.apply( + return /** @type {import('./utils.js').ValueDescriptor} */ (insertAdjacentElement).value.call( this, position, node @@ -232,7 +232,7 @@ export function extendElement(Element) { return parentRealm.insertBefore(this, node); case 'afterend': if (!parentRealm) { - return /** @type {import('./utils.js').ValueDescriptor} */ (insertAdjacentElement).value.apply( + return /** @type {import('./utils.js').ValueDescriptor} */ (insertAdjacentElement).value.call( this, position, node @@ -241,7 +241,7 @@ export function extendElement(Element) { return parentRealm.insertBefore(this.nextSibling, node); case 'afterbegin': if (!realm) { - return /** @type {import('./utils.js').ValueDescriptor} */ (insertAdjacentElement).value.apply( + return /** @type {import('./utils.js').ValueDescriptor} */ (insertAdjacentElement).value.call( this, position, node @@ -250,7 +250,7 @@ export function extendElement(Element) { return realm.prepend(node); case 'beforeend': if (!realm) { - return /** @type {import('./utils.js').ValueDescriptor} */ (insertAdjacentElement).value.apply( + return /** @type {import('./utils.js').ValueDescriptor} */ (insertAdjacentElement).value.call( this, position, node