-
-
Notifications
You must be signed in to change notification settings - Fork 967
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
Can I use the bool attribute with the custom tag? (like "disabled") #1618
Comments
@hajimegane , this bug was introduced by a change in riot which removes the attributes with falsy values except zero, so you can use a number: <my-app>
<button onclick="{toggle}">Click</button>
<my-tag aaa="{this.flg}" disabled="{this.flg}"></my-tag>
this.flg = 0
toggle() {this.flg ^= 1}
</my-app>
<my-tag>
<div>aaa: {opts.aaa}</div>
<div>disabled: {opts.__disabled}</div>
</my-tag> as you are right, |
@aMarCruz Thank you for your reply. I tried to set a number value into the I think that the special bool attributes that start Here is my validation code: http://plnkr.co/edit/ycy8moa3N4RrHSyrzCXe |
@hajimegane it is so. The use of |
@aMarCruz I understand. Thank you. |
fixed in riot@3.0.0 http://plnkr.co/edit/OOznRNFpSUtk57gptMxr?p=preview |
I noticed that bool attributes cannot work in the custom tag's "opts".
1 click: aaa=true, disabled=null
2 click: aaa=null, disabled=disabled
3 click: aaa=true, disabled=disabled
But I expected below.
1 click: aaa=true, disabled=disabled
2 click: aaa=null, disabled=null
3 click: aaa=true, disabled=disabled
Or below.
1 click: aaa=true, disabled=true
2 click: aaa=null, disabled=null
3 click: aaa=true, disabled=true
Should I not use bool attributes with custom tags? (Or Should I use "opts.__disabled"?)
Thanks in advance for your answer.
The text was updated successfully, but these errors were encountered: