Angular ng-repeat causes flickering

后端 未结 5 934
情话喂你
情话喂你 2021-02-04 02:20

I\'m displaying a list of thumbnails with this code:

5条回答
  •  遥遥无期
    2021-02-04 03:20

    Try the answers from @Mark Pieszak and @cexbrayat first, however if you are using ngAnimate in your application, they may not completely solve your problem.

    In addition to:

    I needed to add the following CSS to disable animation for this ng-repeat:

    .channel .ng-leave, .channel .ng-leave-active {
        display: none !important;
    }
    
    .channel .ng-move, .channel .ng-move-active {
        display: none !important;
    }
    

    This ensures that once the animation starts, the item is immediately hidden. The alternatives are to actually use an animation, or to disable the animation on the element in code with $animate.enabled('div.channel', false);.

提交回复
热议问题