-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
{{bind-attr}} in 1.10.0 inserting attributes with falsy values #10395
Comments
We're going to consider this a regression, and include a fix in 1.10.1. The new attributes rules are "prop-first". So In the case of |
Awesome, thanks for the quick response. So when we switch to 1.11 binding syntax ( That works for me, just want to clarify so I can have it on my radar when the time comes to upgrade. 😄 |
Yes, that is the plan. |
In this specific scenario ( <img src="{{doesNotExist}}" alt="image"> http://emberjs.jsbin.com/tudaqegaxi/1/edit?html,js,output The value interpolation occurs with |
Excellent. Thank you both and congrats on shipping HTMLBars! |
I'm experiencing a similar issue with images where setting a value to null, I see chrome try to load
Is this a similar issue?
If value is initially null, it doesn't try to load the image, but when I update the model (to delete the image ,making value null) it's bound to, What am I doing wrong? |
@typeoneerror can you attempt a reproduction in a jsbin? The fact that the URL is The fact that the URL is getting loaded at all seems suspect though. And un-related to anything in this ticket. |
@mixonic not with any real reliability. jsbin seems to forward "null url request" to http://null.jsbin.com/null so tough to repro. I'm guessing it's a "Chrome" thing and I've just forward-proofed current code for 1.10.1. Thanks! |
If
{{bind-attr}}
has an attribute with a falsy value, the attribute will get inserted in the element tag with the stringified version of its value, e.g.:<img {{bind-attr src=propDoesNotExist}} alt="an image" />
will be rendered as:<img src="undefined" alt="an image" />
Here's a jsbin reproduction: http://emberjs.jsbin.com/rulehe/1/edit?html,output
Pre-1.10.0 the rendered output would be:
<img alt="an image" />
Here's a jsbin with
1.9.1
: http://emberjs.jsbin.com/miwola/1/edit?html,output/cc @rwjblue
The text was updated successfully, but these errors were encountered: