Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Attributes with numeric value not rendered #82

Open
mohtar opened this issue May 11, 2017 · 1 comment
Open

Attributes with numeric value not rendered #82

mohtar opened this issue May 11, 2017 · 1 comment

Comments

@mohtar
Copy link

mohtar commented May 11, 2017

<textarea rows="10" /> is OK but <textarea rows={10} /> where the attribute value is a number results in not being rendered.

@mijamo
Copy link

mijamo commented May 19, 2017

I think the cause is the same as #77 .

https://github.com/FormidableLabs/rapscallion/blob/master/src/render/attrs/index.js#L31

As attrVal is in this case 10, the condition Object.keys(attrVal).length > 0 is not satisfied and thus no attribute is inserted, same case when the value is true (my problem on isue #77 ).

I am not sure what that condition is supposed to check so I have been unwilling to submit a pull request.

My suggestion would be to change that check for something that would allow numeric and boolean values (or at least true) and explain in a comment what that check is supposed to do because it is really unclear right now and it prevents us from helping solving issues.

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

No branches or pull requests

2 participants