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

Documentation for boolean attributes #1548

Closed
charleschege opened this issue Sep 9, 2020 · 3 comments · Fixed by #1913
Closed

Documentation for boolean attributes #1548

charleschege opened this issue Sep 9, 2020 · 3 comments · Fixed by #1913

Comments

@charleschege
Copy link

Special handling for boolean attributes like <div contenteditable></div>, where contenteditable should be coded as contenteditable=true, should be documented in the yew docs

@jstarry
Copy link
Member

jstarry commented Sep 9, 2020

Thanks @charleschege!

@lukechu10
Copy link
Contributor

Why can't <div contenteditable></div> be handled as is by the parser? If it's possible, it would make it more similar to vanilla html and could prevent a few headaches.

@siku2
Copy link
Member

siku2 commented Feb 23, 2021

Why can't <div contenteditable></div> be handled as is by the parser? If it's possible, it would make it more similar to vanilla html and could prevent a few headaches.

I think this is still mainly a documentation issue. Sure, we could add that syntax for convenience but then I fear users will start asking how to disable a boolean attribute instead. Enforcing a strict key=value syntax is also easier to handle for components, which can't easily support boolean attributes like that.
If you want to add the special handling for this though then by all means, go ahead.

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.

4 participants