Skip to content

Undefined attributes in spread #3067

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

Closed
RedHatter opened this issue Jun 21, 2019 · 2 comments · Fixed by #3876
Closed

Undefined attributes in spread #3067

RedHatter opened this issue Jun 21, 2019 · 2 comments · Fixed by #3876

Comments

@RedHatter
Copy link
Contributor

When some attributes are undefined and set through spread, svelte sets the dom attribute to "undefined". This is caused by src/runtime/internal/dom.ts#L103-L104. The only way I can think to solve this is to include the list of boolean attributes in the runtime.

See repel.

@ghost
Copy link

ghost commented Jul 25, 2019

The "undefined" attributes happen whether in a spread or not.

I think the more general issue is that most of us expect the framework to "eat" undefined values and not pollute the DOM. From a purist point of view, Svelte is doing the right thing by not implicitly doing anything so I suppose this would be more of an enhancement.

See: REPL

@RedHatter
Copy link
Contributor Author

After #3013 most attributes ignore undefined. class is an exception.

@Conduitry Conduitry added the awaiting submitter needs a reproduction, or clarification label Jul 30, 2019
@Conduitry Conduitry added feature request and removed awaiting submitter needs a reproduction, or clarification labels Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants