Ng-if and scroll ability update

Hello Ionites,
I have a view where I toggle the visiblity of an item by (ng-)clicking on a button with ng-if on a scope property.
When I do so it adds html to the view so that I need to scroll down to see the new element, however, it takes a very long time (a couple of seconds) for the app to notice that there is something below and to allow scrolling.

I think I should move this behaviour in a directive, but do you see something that could go wrong besides that?

Thanks
Félix

You can resize the scroll window when they click the button so you don’t need to wait for it to resize: $ionicScrollDelegate.resize()

Check this codepen (click the add items button): http://codepen.io/anon/pen/JoNpVq?editors=101

1 Like

Works like a charm ! thanks

1 Like