-
Notifications
You must be signed in to change notification settings - Fork 27.5k
fix(ngHref): remove attribute when empty value instead of ignoring #6986
Conversation
Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.
If you need to make changes to your pull request, you can update the commit with Thanks again for your help! |
The idea is that we remove the src/srcset/href attribute when value is empty. This works well on IE8 for both images and href. Please advise if I should write specific tests for |
Despite correctly removing the href attribute, I think it would be better to ensure that the original |
@caitp I'm not sure I understand what you mean. Can you elaborate? |
the original patch is meant to just avoid changing the |
The only difference in my implementation is that when the source becomes blank I will remove the The way I see it, the previous implementation wanted to avoid downloading of image with blank url, but solved it by creating a behavior which is not intuitive, while the new implementation solved the download of blank url with behavior that makes more sense. I could change this to exclude |
I believe the reason they don't want to change the URL is because they don't want to see FOUC-ish behaviour with the image beginning to load and then being removed, possibly multiple times |
Not sure I understand when the value can change from non-blank to blank multiple times, but I pushed an amended commit which makes this work only for |
@caitp - I've rebased this. |
Where are we on this one ? I have the same problem :-( |
Also encountering this problem in Ionic. Any updates? Anything that needs to be done to help it get merged? |
This LGTM. @caitp shall we merge this? |
yes, sure. My source tree is a bit busy right now (promise refactoring), so it will be a while before I can check it in. You should do it! |
✨ consider it done ✨ |
Awesome! Thanks. |
Now anchor tags with |
this will allow updating the values of ng-src, ng-srcset, ng-href back to empty state while preserving the intended behavior of not setting the attribute to an empty string to prevent behavior like trying to download the current page as an image or creating a link to the current page.
Fixes #2755