Skip to content

Rationale behind bool in attrs #13

Answered by WebReflection
CheloXL asked this question in Q&A
Discussion options

You must be logged in to vote

it's already implemented in both hyperHTML and lighterhtml, and it's ambiguous for the following reasons:

  • sloppy code/lazy developers not passing along boolean values but null or undefined instead, or even empty strings, expected attributes to be removed or added same way (null is an explicit intent to remove listeners as DOM Level 0, as example, while false is not even allowd in there)
  • what uhtml provides via the . prefix, is a 1:1 behavior of what you would do via JavaScript, if you had the node reference. .contentEditable=${true | false} is an example, and please note the camelCase, while .hidden is another one, and the mistake there is to believe SVG elements have an .hidden accessor…

Replies: 2 comments 15 replies

Comment options

You must be logged in to vote
15 replies
@CheloXL
Comment options

@CheloXL
Comment options

@WebReflection
Comment options

@CheloXL
Comment options

@WebReflection
Comment options

Answer selected by WebReflection
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants