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

Boolean attribute oddity with relation to HTML5 #703

Closed
dead-claudia opened this issue Feb 19, 2018 · 1 comment
Closed

Boolean attribute oddity with relation to HTML5 #703

dead-claudia opened this issue Feb 19, 2018 · 1 comment
Labels

Comments

@dead-claudia
Copy link

Would it be possible to make the empty string an alias for "true" (for relevant attributes) for HTML5 shorthand compatibility?

According to this React comment, every boolean attribute defaults to "false" if not present. However, from a quick search of the spec, some roles (e.g. role="alert") change the default to true (in that case, aria-checked), so I can see the value of a separate true/false that's more than just presence/non-presence. However, HTML5 idiomatically prefers the empty string for things that are conceptually true, and has a special syntax for that to encourage such definitions and usage. So would it be possible to accomodate that by making "" an alias for "true" for attributes that accept an attribute named "true" (provided it doesn't conflict with other possible values)?

@jnurthen
Copy link
Member

While I understand the desire for this it is not something we can change at this point in time.

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

No branches or pull requests

2 participants