Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Class does not remove when value becomes false #2082
Help us to manage our issues by answering the following:
Describe your issue:
Class does not remove when value becomes
I think that behavior is against the explanation:
This bug(?) only encounter on
For details, please refer to the examples below.
Can you reproduce the issue?
Yes, Compare behaviors:
Which version of Riot does it affect?
How would you tag this issue?
Thanks, Great lib!
Here's another 'workaround':
Note the additional attribute - if I set
Another 'workaround' which might help uncover the cause if this:
Hello. I think we need to have all keys from expression in update.js component to easy update DOM element classes. Because now you have this code:
if (value === 0 || value && typeof value !== T_OBJECT) setAttr(dom, attrName, value)
If value is empty, Riot.js will dont delete exists classes.
If think you must add after it something like this:
You already have values. Main problem now is get all keys from expression. Maybe create in
Or just add
if (value === 0 || value && typeof value !== T_OBJECT) setAttr(dom, attrName, value) else remAttr(dom, attrName)
This approach fixes this issue too.