-
-
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
Image src
Always Fetched, Even When Guarded
#10675
Comments
I have the same problem. I had talked @rwjblue about this on irc. He said it was fixed in latest builds of 1.10 but I continue to see it. |
Do you have a JSBin replicating the issue? It'd certainly save me some time trying to replicate the problem :) |
Unfortunately not, I only have an ugly hack which is to wrap img tags with if blocks. |
One more question: did you already have an issue open? I can nuke this issue if you do. |
Nope, this is the only issue. |
Should have been fixed by #10398. |
@rwjblue Any plans to release |
Awesome! I'll be sure to test it out. |
@quaertym unlikely, 1.11 should be out any day now. |
@dgeb - Sounds good. Will keep an eye out... |
This resolves a problem in the legacy `bind-attr` implementation in which `src` attributes would be set to `null` instead of being removed or cleared. This led to spurious fetches for invalid assets. [Fixes emberjs#10675]
This bug appears to be back in 1.11.3 |
Offending code looks like this: {{#if hasCoach}}
{{#link-to "your-coach" class="pn-mainMenu__item grid__item one-whole close"}}
<div class="grid grid--full">
<section class="pn-mainMenu__text grid__item nine-tenths push--one-tenth">
<img src={{coachPhotoUrl}} class="inline-icon rounded">
Coach {{coachFirstName}}
</section>
</div>
{{/link-to}}
{{/if}} Even if I do the following, the problem still crops up: {{#if hasCoach}}
{{#link-to "your-coach" class="pn-mainMenu__item grid__item one-whole close"}}
<div class="grid grid--full">
<section class="pn-mainMenu__text grid__item nine-tenths push--one-tenth">
{{#if coachPhotoUrl}}<img src={{coachPhotoUrl}} class="inline-icon rounded">{{/if}}
Coach {{coachFirstName}}
</section>
</div>
{{/link-to}}
{{/if}} The only work around is to use the old |
Reopening to review, but I think the following hack should work in the interim: <img src={{if coachPhotoUrl coachPhotoUrl ""}} class="inline-icon rounded"> |
I'll give that a try. I think, in general, the guide on bound attributes may need some TLC. If a work around is suitable here, I'll open a pull request documenting it in the guides repo. |
FYI I finally got around to trying the workaround, and it didn't work. |
Glimmer should have fixed this |
I'm upgrading an application from 1.8.1 to 1.10, and I've run into a bit of an ugly problem with template rendering.
The offending code is as follows:
This is found on a menu bar in our application, and these values will change depending on which membership a student has selected.
In the offending scenario we start by visiting a membership where
hasCoach
is false, ergo the snippet above should not be rendered. Next we switch to a membership that does have a coach (render the snippet), and then back to the membership without a coach. At this point the following error is in the JavaScript console:I can verify that it's the above snippet causing the problem by commenting out the image, at which point the error doesn't occur.
I've attempted 1.11.0-beta5 and the same issue is in play.
I haven't a JSBin to replicate this yet, but I will attempt to do so soon. I'm available to ScreenHero if anyone is interested in trying to tackle this.
The text was updated successfully, but these errors were encountered: