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

Data attribute without value is assigned the string "true" #2803

Closed
trbrc opened this issue May 17, 2019 · 1 comment · Fixed by #2804
Closed

Data attribute without value is assigned the string "true" #2803

trbrc opened this issue May 17, 2019 · 1 comment · Fixed by #2804

Comments

@trbrc
Copy link
Contributor

trbrc commented May 17, 2019

If you use a data attribute without a value, the generated code tries to assign true to the corresponding key in the dataset, which is coerced to "true". Normal HTML behavior is to use the empty string.

Example in REPL:

https://svelte.dev/repl/66aad97e4c734ebfbb4e7ef898e07bcd?version=3.4.1

Kinda related to #1852

@Shyam-Chen
Copy link

Not working with the customElement: true option.

<soft-shape pressed></soft-shape>

The pressed attribute is false.

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