angular-ui/ui-utils

why the ui-scroll directive create 2+fixed amount element?

HeavenGoGo opened this issue · 1 comments

I have 200 record, when I use ui-scroll to bind it to the UI, assume I use li to display data, there will be 202 li elements there , the first one and last one have a style that height is 0. is there any method to avoid this?

Nope. These elements are added to make sure the scroll bar can be used to scroll up (down) even if currently there is no elements. This will initiate a request to the server to (may be) pull more elements. Initially these elements are styled to have 0 height, but as the elements are removed as they are scrolled out of view, the height of the removed elements is added to the height of the appropriate filler elements. It is up to you to style them so that they do not confuse the user