Skip to content
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

x-bind:[attribute] on a falsy value still includes the attribute #485

Closed
richgcook opened this issue May 13, 2020 · 5 comments · Fixed by #486
Closed

x-bind:[attribute] on a falsy value still includes the attribute #485

richgcook opened this issue May 13, 2020 · 5 comments · Fixed by #486

Comments

@richgcook
Copy link

If I write x-bind:href="article.external_url" and if the value of article.external_url is null or false then in Alpine the href is still bound but with a value of null

Screenshot 2020-05-13 at 23 57 07

However, from the Vue.js docs, for example: https://vuejs.org/v2/guide/syntax.html#Attributes

If isButtonDisabled has the value of null, undefined, or false, the disabled attribute will not even be included in the rendered element.

What is the expected output here?

@SimoTod
Copy link
Collaborator

SimoTod commented May 13, 2020

The one you experienced at the moment. We discussed that a while ago on this thread: #280 (comment)

@richgcook
Copy link
Author

The one you experienced at the moment. We discussed that a while ago on this thread: #280 (comment)

Oh! And no outcome? Hmm.

@SimoTod
Copy link
Collaborator

SimoTod commented May 13, 2020

We were waiting for feedback then we just forgot, I suppose. 😂

@HugoDF
Copy link
Contributor

HugoDF commented May 14, 2020

We can open a PR for it.

I think Caleb's unlikely to merge it because it's gonna have too many changes 🤷🏼‍♀️

@HugoDF
Copy link
Contributor

HugoDF commented May 14, 2020

@richgcook could you move your use-case comment into that other issue (& close this one)?

The more people mention it's a problem, the more likely we'll go fix it.

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

Successfully merging a pull request may close this issue.

3 participants