kamilkp / angular-vs-repeat

Virtual Scroll for AngularJS ngRepeat directive
http://kamilkp.github.io/angular-vs-repeat/
MIT License
818 stars 228 forks source link

A dynamic change in the height of scrolled items results in many items not displayed #181

Open szalapski opened 6 years ago

szalapski commented 6 years ago

See example here: https://codepen.io/szalapski/pen/RjErZV

Steps to reproduce:

  1. Load the example at https://codepen.io/szalapski/pen/RjErZV . Notice the bottom section scrolls well, showing all 1000 items.
  2. Scroll back to the top of the rendered page and uncheck "Tall version". This makes every item about half as tall.

Then scroll down more than halfway and notice that (1) not all 1000 items can be seen, and (2) the scroll region is not filled with items in every case.

Any chance you would know how to fix?

szalapski commented 6 years ago

I tried calling $rootScope.$broadcast('vsRepeatTrigger'); when I changed the size of the elements--as a workaround--but it had no effect; I still see the same symptom.

tstpierre commented 6 years ago

Seeing the same thing, broadcasting vsRepeatTrigger doesn't appear to do anything.

I have a row that is either 80 or 130 pixels fixed based on if a certain mode is turned on. broadcasting vsRepeatTrigger after that switch toggles the boolean under the hood still throws size warnings despite size being set to the view model binding expression.

tstpierre commented 6 years ago

I was able to resolve this by messaging the toggle via rootScope (its elsewhere in the component composition) and then in the specific component that was home to vs-repeat in the template: