Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ember: Avoid UI flickering when content changes

I have a ArrayController which has some content (say array of 10 objects) and a View which is rendering the list of all ArrayController elements.

Now when the content changes the view is emptied and then reconstructed. This causes UI Flickering. This flickering is irritating to eyes.

So any suggestions on how to fix this type of issues or minimize the side-affects?

like image 914
Ankur Agarwal Avatar asked Nov 16 '12 04:11

Ankur Agarwal


1 Answers

I found that if in the templates I do something like

{{#each controller.content}}
  {{contentAttribute}}
{{/each}}

then I get a flicker. But if I just use the ArrayController itself in my templates I don't get the flicker:

{{#each controller}}
  {{contentAttribute}}
{{/each}}
like image 93
Andre Malan Avatar answered Nov 12 '22 19:11

Andre Malan