Skip to content

Commit 32af943

Browse files
fix: never set custom element props as attributes (#12622)
* fix: never set custom element props as attributes * changeset --------- Co-authored-by: Rich Harris <[email protected]>
1 parent 0f41689 commit 32af943

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.changeset/fifty-toys-invite.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"svelte": patch
3+
---
4+
5+
fix: never set custom element props as attributes inside templates

packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2152,6 +2152,7 @@ export const template_visitors = {
21522152
}
21532153

21542154
if (
2155+
!is_custom_element &&
21552156
attribute.name !== 'autofocus' &&
21562157
(attribute.value === true || is_text_attribute(attribute))
21572158
) {

packages/svelte/tests/runtime-legacy/samples/attribute-custom-element-inheritance/_config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { test } from '../../test';
22

33
export default test({
4-
skip: true, // TODO: needs fixing
5-
4+
mode: ['client'],
65
html: `
76
<my-custom-inheritance-element>Hello World!</my-custom-inheritance-element>
87
`

0 commit comments

Comments
 (0)