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

Attributes with no value #48

Open
thiagoarantes opened this issue Apr 21, 2021 · 2 comments
Open

Attributes with no value #48

thiagoarantes opened this issue Apr 21, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@thiagoarantes
Copy link

When adding an attribute that requires no value inside a tag, the HTML addon renders it with it with like [arttribute]="" intead of only [attribute]

Ex.

<input type="text" readonly /> <input type="checkbox" checked />

renders

<input type="text" readonly="" /> <input type="checkbox" checked="" />

It would be nice if this ="" was removed from the rendering. Thanks

@jeanfredrik
Copy link
Member

We’re using the built-in DOM property innerHTML to retrieve the HTML from the DOM and this is how it treats empty attributes. That being said, I agree that checked is more neat than checked="" so it might be worth looking into, but I think it requires extra parsing.

@jeanfredrik jeanfredrik added the enhancement New feature or request label Apr 23, 2021
@dgibson666
Copy link

I dug into this a while back and it seemed it was dictated by a node module dependency, so it wasn't easily updated by us. But +1. This affects regular HTML and web components with Boolean props.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants