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

attribute empty-string is translated into 'true' #224

Open
imbroglioj opened this issue May 27, 2017 · 1 comment
Open

attribute empty-string is translated into 'true' #224

imbroglioj opened this issue May 27, 2017 · 1 comment

Comments

@imbroglioj
Copy link

When an attribute like href or placeholder is assigned the empty string; react-templates replaces the empty string with true
Example: placeholder="" --> {... placeholder: true ...}
A workaround is to enclose the empty-string in curly braces: {""}.
(Coming from Angular, I've become a big fan of react-templates in the last couple days. The amount of empty boilerplate and crufty JSX+JS it replaces is impressive. And the ability to step through the resulting rt.js for debugging is a lifesaver.)

@nippur72
Copy link
Contributor

they are translated into true in order to support boolean attributes, e.g.:

<input disabled />   <!-- becomes: disabled=true -->

This because in HTML <input disabled /> and <input disabled="" /> are the same thing.

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

No branches or pull requests

2 participants