ng-hide and ng-show showing at the same time for a short period of time in IE11 #14015
Comments
This sounds familiar. The problem is that I can never reliably reproduce these in IE11. It has happened maybe once in 30 times for me. I've also seen it once on Firefox, so it maybe has something to do with how fast the browser flushed the requestAnimationFrame queue, or with how long we take to detect if animations are allowed. |
Can you please test with the latest snapshot: http://code.angularjs.org/snapshot/angular-animate.js and see if it happens less often? |
In my IE11 I get the flash of both showing every time I click the checkbox. Using the linked angular-animate didn't seem to change this behavior. |
That's weird. What IE and OS version do you have? And is your computer generally slow or under load? |
We have quite high-end computers (I tried on three of them), my initial guess was actually that it was fast enough to show something which is only visible for a short amount of time. I'm running Windows 8.1 with IE version 11.0.9600.18202. One of the computers I tried it on was Windows 7, showing the same problem. |
I'm currently applying this css to avoid the problem: This could of course cause problems for us in the future if we want to animate some ng-hide and not animate some. |
Hm, I didn't think about the computer being too fast. That could it be it. I also have a slightly newer version of IE11 (11.0.9600.18204), but I doubt that this is the reason. |
I tried this now in IE11 on my virtual Windows 7, and experience the problem maybe once every 2-10 try. This could be because my virtual machine is running slower, but this is only a guess. |
I'm having the same problem in Chrome, w/ an ng-switch. The specific case where it happens is when a view value change in ngModel is committed, which a) removes a |
@Plestik can you post a demo in a plnkr.co or similar? |
@Narretz I'll give it a shot. But is this even supposed to work w/ nested animations if it only runs one group of animations every frame? |
Sorry, can't reproduce it in a Plunkr. |
@Narretz is there anything I can do to help resolve this issue? If you want to, I can provide you w/ login credentials for our staging environment where I can reproduce it consistently. Edit: I missed the part of the docs where it quite clearly says that combining structural animations w/ class animations can lead to flickering. Never mind me, then. |
I am experiencing similar issues on Chrome with OS X. In my case it's two ng-show's with distinct display conditions (which are never true at the same time). Even if I toggle the two conditions immediately after one another, there is a brief moment where both elements are visible. This doesn't happen in all page configurations, but happens pretty consistently in one particular case. |
I also have the same issue in Chrome on Windows, using angular and angular-animate 1.4.12. @PhilipWallin solution is a good workaround for now. |
I'm experiencing the same issue in the iOS Simulator for iOS 9.3. I have uploaded a video demonstrating the issue: https://youtu.be/C0Lh5B1Lj6k |
I recently got my hands dirty using Angular material and included in my existing project and started experiencing this flickering behavior in Chrome while using ng-if/ng-show. After some trail and error found the issue caused due to "ngAnimate". @PhilipWallin solution works as a workaround for me and not sure what would not work in future. Just added the below in my CSS and replaced my "ng-if" to "ng-show" P.S : using Angular and ngAnimate version v1.5.7 |
+1 |
Hi, I am experiencing a similar issue with angular 1.5.8 (having just upgraded from v 1.12.15). The problem is very apparent under IE11, it is there under Chrome also but more often than not the transition is too fast to notice. The directive i have is a tab control that uses transclusion to include tab pages. The flicker i am experiencing (which briefly shows the new and old active tab page html side by side) is when the user switches between tabs (i.e. after compilation and template loading). The code uses ng-show with a boolean flag to decide whether or not to display the page (of which a maximum of 1 is active at any one time). The work around i had been planning to use was to use ng-class with the same ng-show conditional flag to activate a custom css class '.myCloak { display: none !important}' (i.e. the same css used by ng-cloak) e.g. I will attempt to create a plunkr to demonstrate but it may take a while. In the meantime i will attach a screen shot of the issue as it appears in our app under IE11 and the video it was taken from. On the screen shot the area within the thin red rounded rectangles show the tab page that is incorrectly being displayed and the relevant DOM inspection. The blue rounded rectangle areas highlight the active tab which is also shown. By playing the video [http://take.ms/czZZV] you will see that it is not consistent but it does happen often. |
I have the same issue on chrome 54 with Angular 1.5.8. @PhilipWallin solution works for now too. Any idea what the cause could be? |
Hello, I have managed to put together a plunk showing this behavior: [https://plnkr.co/edit/PTrvz8] If you run it under IE11 and switch between the tab pages you should see it. The code is a little ugly but it shows the problem. If you uncomment the ng-hide-animate override in style.css ( @PhilipWallin work around) the problem goes away. I will tidy this up on monday and post a video of the problem using the plunk in case you still can't reproduce. Hope this helps... |
I have tidied up the plunk a little and added a description, |
As @teterovic discovered in issue #13974 this behavior seems to have be introduced in version 1.4.5. If you change the angular and angular-animate versions on the plunk to 1.4.4 the behavior is not there, up it to 1.4.5 and it appears. |
@garycuthbert Thanks for the plnkr, it shows the issue very well (in IE11). I will investigate and see if there's anything we can do. |
Hi Narretz, Also in the patch I noticed at once double equal '==' has been used where after changing it to '===' it works. Which is correct syntax for condition check. I also have tried this in further version 1.5.9 and 1.6.0, it's not still working with patch anyway. Any help will be highly appreciable. Thanks |
I will review @gkalpak's PR after Christmas, and then we can hopefully get it in quickly. |
Tried in further versions not working in 1.5.9 and 1.6.1. Any help / suggestion will be highly appreciable. Thanks |
Still the same issue with 1.5.10 |
Had the same issue, wanted to try to upgrade to 1.6.1 from 1.3.x and had to downgrade again to 1.4.4. What an embarrasment for the Angular team |
@stijn26 you did probably something wrong and this should be an stackoverflow question but anyway:
|
I checked all breaking changes and modified them, all modules were updated. I had the exact same issue as the rest of the persons in this thread. |
@mmomeni @stijn26 @teterovic
|
I'm getting this flicker with ng-show on angular 1.6.3 on Chrome 57 on Windows 7. The display: none on .ng-hide.ng-hide-animate fixes it for me. |
@samal84 can you please provide a demo? I cannot reproduce this in Chrome 58 with the plnkr in the first post updated to 1.6.4. |
Ok it looks more like a bug with angular material md-switch, now that I tried to make a minimal demo: http://plnkr.co/edit/hR2B8yEPjak0v2Yryid1?p=preview Try clicking the switch quickly, and you should see that on/off inside and outside the md-switch behave differently. The one inside flickers with both being rendered for a split second, while the one outside is fine. |
@samal84 That is also fixed by disabling $animate (which angular-material uses). Demo: |
When including ng-animate there seem to be a brief period of time where a ng-show and ng-hide element are showing at the same time, even if no animations are used.
Example (the problem is only visible if using IE11):
http://plnkr.co/edit/vqVGcf9cjFQPAbq0Igyq?p=preview
In the example you can see the flickering of the two elements showing at the same time when checking and unchecking the checkbox which trigger ng-show/ng-hide.
The text was updated successfully, but these errors were encountered: