-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Styles not being removed when evaluated to null in IE #7916
Comments
I've just stumbled upon this issue as well. Strangely enough, nullifying a CSS property worked with Angular 2 Beta 9 in my application, but not with Beta 14. The documentation on directives, which makes use of setting a CSS property to null, should probably be updated as well: https://angular.io/docs/ts/latest/guide/attribute-directives.html |
@ComFreek would you mind to provide an example of your case working with beta.9? Mine (the plnkr above) doesn't work with beta.9. |
@ericmartinezr Yesterday, I couldn't reproduce the behavior with a fresh Plunkr and Beta 9, however, I could exactly reproduce it with my old code base. Today, very bizarrely, the behavior of my old copy changed after clearing IE's cache, i.e. nullifying elem.style.backgroundColor (in my case) has no effect anymore. Maybe the behavior was due to the following specifics of my application: Each time the user clicked on an SVG rectangle (loaded inside an
I could imagine this triggered an (internal) refresh, so that the UI elements were re-generated and the previous styles therefore lost. |
It got worst with RC.1, now http://plnkr.co/edit/VugA7MtjAv8v69Tl1XGU?p=preview I'm not sure this is related to #8491 but I wouldn't be surprised |
|
Can confirm, |
Still reproducible with RC6 http://plnkr.co/edit/ysSKiXLb9E7UnSpb3sNL?p=preview (IE11) |
probably a bug in the renderer |
Is this still an issue in 2.0.1 ? |
@vicb yes, it is still an issue, plnkr is the same with latest zone http://plnkr.co/edit/POko9BTz4TUpF9q16tkR?p=preview, in the network tab you can see that ng2 2.0.1 is being downloaded (don't know how to make it run against master using *-builds). |
if ( isRed ) |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Steps to reproduce and a minimal demo of the problem
See this plnkr http://plnkr.co/edit/WPKg2KgIXMIxugSpXEMQ?p=preview
What steps should we try in your demo to see the problem?
Press the "change my bg color" button as much as you want, it should toggle the div's background from none to red, and viceversa.
Now, to see it working for real in IE, change
to
with that will work correctly in both chrome, IE and FF.
I got this solution/workaround from @alexhub in gitter's chatroom.
Current behavior
In chrome works perfectly, but in IE the background color is added but not removed.
Expected/desired behavior
It should work with
null
in all browsers, or it should be changed to''
to work with most of them.Other information
IE11 - 11.0.9600.18230
IE10 (emulated)
IE9 (emulated)
All with the same behavior.
Should this line be changed to use an empty string instead?
The text was updated successfully, but these errors were encountered: