diff --git a/.changeset/fifty-toys-invite.md b/.changeset/fifty-toys-invite.md new file mode 100644 index 000000000000..2dd19c3b0431 --- /dev/null +++ b/.changeset/fifty-toys-invite.md @@ -0,0 +1,5 @@ +--- +"svelte": patch +--- + +fix: never set custom element props as attributes inside templates diff --git a/packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js b/packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js index 3e8fff654f6d..0548d7a1432c 100644 --- a/packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js +++ b/packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js @@ -2152,6 +2152,7 @@ export const template_visitors = { } if ( + !is_custom_element && attribute.name !== 'autofocus' && (attribute.value === true || is_text_attribute(attribute)) ) { diff --git a/packages/svelte/tests/runtime-legacy/samples/attribute-custom-element-inheritance/_config.js b/packages/svelte/tests/runtime-legacy/samples/attribute-custom-element-inheritance/_config.js index 0b5365a9f1f3..396048c91acc 100644 --- a/packages/svelte/tests/runtime-legacy/samples/attribute-custom-element-inheritance/_config.js +++ b/packages/svelte/tests/runtime-legacy/samples/attribute-custom-element-inheritance/_config.js @@ -1,8 +1,7 @@ import { test } from '../../test'; export default test({ - skip: true, // TODO: needs fixing - + mode: ['client'], html: ` Hello World! `