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 optional values default to falsy #12

Closed
ssorallen opened this issue Jan 5, 2015 · 0 comments · Fixed by #13
Closed

Attributes with optional values default to falsy #12

ssorallen opened this issue Jan 5, 2015 · 0 comments · Fixed by #13

Comments

@ssorallen
Copy link
Contributor

Attributes with optional values, like disabled for example, are assigned an empty string as their value making them evaluate as falsy. In HTML, if the value is omitted the attribute defaults to truthy and so should be the case in the transform.

Currently:

> converter.convert("<input disabled>")
"<input disabled="" />
"

What should happen:

> converter.convert("<input disabled>")
"<input disabled />
"

JSX properly converts attributes with no values to true.

Daniel15 referenced this issue Jan 6, 2015
Maintain value-less attributes handled by JSX
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.

1 participant