Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different behavior for custom elements that extends builtin element. #15085

Closed
edoardocavazza opened this issue Jan 22, 2025 · 0 comments · Fixed by #15086
Closed

Different behavior for custom elements that extends builtin element. #15085

edoardocavazza opened this issue Jan 22, 2025 · 0 comments · Fixed by #15086

Comments

@edoardocavazza
Copy link
Contributor

Describe the bug

I noticed that Svelte behaves differently when it comes to setting properties to a custom element.

When the custom element is autonomous (eg <my-element>), it behaves correctly, passing the attributes as properties.
If instead the custom element extends a builtin element (eg <a is="my-link">) Svelte does not pass the attributes as properties.

The problem I guess comes from this check that checks only the name tag of the node:

export function is_custom_element_node(node) {

Reproduction

https://svelte.dev/playground/hello-world?version=5.19.1#H4sIAAAAAAAAE62NsY7CMBBEf2W1DU1IeitEQjRX3B8QpGxgkQyObXk3XFCUfz_5Du4aSqqRnmbmzehpYDS4G0XDAOx4YK8CyqJY4Nk6FjT7GfUecy8DLJ6rbYyl3NhpZj0Jv-LH4DV_osF6Wj8MEPoLH3Uzzz8qA6sPdi7AV0jutIJlaT5DuAIpDHcg1WT7UVlK6H6HHViBSCJ8AhIgiCnEsq7-BE3r6z5BlZPAyqbFae2sv7b4brf_L5V1RU3rsUDlSdFoGnk5LN_Mqu7kZwEAAA==

Logs

System Info

Svelte 5.19.1 (Playground)

Severity

annoyance

dummdidumm pushed a commit that referenced this issue Jan 22, 2025
Fixes #15085

Add a check for is attribute in is_custom_element_node function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant