rapscallion
rapscallion copied to clipboard
Attributes with numeric value not rendered
<textarea rows="10" />
is OK but <textarea rows={10} />
where the attribute value is a number results in not being rendered.
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.