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

Support boolean attributes #91

Merged
merged 1 commit into from Feb 10, 2014

Conversation

Projects
None yet
3 participants
@th0r

th0r commented Feb 9, 2014

Current v-attr implementation doesn't support boolean attributes (e.g. disabled).
Here is the common use-case:

<button type="submit" v-attr="disabled: !submittionAllowed">

It doesn't work because v-attr uses this.el.setAttribute method. So, when submittionAllowed equals to true, then submit button will look like this:

<button type="submit" disabled="false">

...which is treated by browser as disabled button.
My proposal is to remove current attribute if it's value is falsy (except zero).

@yyx990803

This comment has been minimized.

Show comment
Hide comment
@yyx990803

yyx990803 Feb 9, 2014

Member

Hi Yuriy, I have tested locally and it's looking good. Just one final thing: please do not include the /dist files in the commits. If you can reset and make a single clean commit without the /dist files it will be good to merge. (You can just push -f to your current branch)

Member

yyx990803 commented Feb 9, 2014

Hi Yuriy, I have tested locally and it's looking good. Just one final thing: please do not include the /dist files in the commits. If you can reset and make a single clean commit without the /dist files it will be good to merge. (You can just push -f to your current branch)

@th0r

This comment has been minimized.

Show comment
Hide comment
@th0r

th0r commented Feb 9, 2014

@yyx990803 Fixed! =)

yyx990803 added a commit that referenced this pull request Feb 10, 2014

@yyx990803 yyx990803 merged commit 1946a51 into vuejs:dev Feb 10, 2014

@yyx990803

This comment has been minimized.

Show comment
Hide comment
@yyx990803

yyx990803 Feb 10, 2014

Member

Merged! Thanks for the great work! 👍

Member

yyx990803 commented Feb 10, 2014

Merged! Thanks for the great work! 👍

@kristoferjoseph

This comment has been minimized.

Show comment
Hide comment
@kristoferjoseph

kristoferjoseph Feb 10, 2014

🍻 I just ran into this. Thanks!

kristoferjoseph commented Feb 10, 2014

🍻 I just ran into this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment