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

svelte:element custom element not updating when setting property to null/undefined #7733

Closed
ffossum opened this issue Jul 28, 2022 · 2 comments · Fixed by #7766
Closed

svelte:element custom element not updating when setting property to null/undefined #7733

ffossum opened this issue Jul 28, 2022 · 2 comments · Fixed by #7766

Comments

@ffossum
Copy link

ffossum commented Jul 28, 2022

Describe the bug

When using svelte:element with a custom element, setting a property to a null or undefined does not work. The setter on the custom element is simply not called. This is in contrast to the behavior when rendering the custom element directly using its registered tag name. In that case the element is updated as expected and the setter is called with null.

The REPL example shows the same custom element rendered twice. Once using svelte:element and once using its tag.
Clicking the button will rotate a name property between a string, null and undefined.

I would expect both of these to render the same, but the svelte:element version does not update whenever the value becomes null or undefined. As you can see in the console, its setter is never called.

Reproduction

https://svelte.dev/repl/e38d35f309f64c19b4f1028fe43a0be1?version=3.49.0

Logs

No response

System Info

Svelte 3.49

Severity

annoyance

@Conduitry
Copy link
Member

This should be fixed now in 3.51.0 - https://svelte.dev/repl/e38d35f309f64c19b4f1028fe43a0be1?version=3.51.0

@ffossum
Copy link
Author

ffossum commented Oct 10, 2022

Awesome! 👍

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.

2 participants