You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
after the data of an already scrolled ion-list is reset, the value _highestY in infinite-scroll.ts#L171 prevents infinite scrolling.
What behavior are you expecting?
A convenient way to reset the infiniteScroll should be possible, useful for example with search results, where a new search resets the content of the view.
Since private variables in TypeScript are not realy private in JavaScript I do this for now ...
// Hack hack until a right way is implemented ... :(//noinspection TypeScriptUnresolvedVariablethis.infinite._highestY=0;//noinspection TypeScriptUnresolvedVariablethis.infinite._lastCheck=0;
Thanks for opening this issue, it definitely helped exposed a problem with it's current API. Like you pointed out, once the data changes and it's height is smaller than before, then infinite scroll no longer works. I just removed the need for highestY checks entirely, since I think requiring the reset() function called every time data changes would be problematic.
@wieseljonas have a look at the sources you can simply store the passed InfiniteScroll to a member variable and then access it from outside of the event emission.
@sclausen still this seems to be workaround. I wonder if there is any new issue regarding resetting infiniteScroll mentioned by @wieseljonas or should it be created?
Activity
cmanou commentedon Mar 11, 2016
Another option would be to remove the highestY, though that will impact performance.
beerbohmdo commentedon Mar 11, 2016
Since private variables in TypeScript are not realy private in JavaScript I do this for now ...
adamdbradley commentedon Mar 12, 2016
Thanks for opening this issue, it definitely helped exposed a problem with it's current API. Like you pointed out, once the data changes and it's height is smaller than before, then infinite scroll no longer works. I just removed the need for highestY checks entirely, since I think requiring the reset() function called every time data changes would be problematic.
fe04c51
Thanks!
wieseljonas commentedon Mar 22, 2016
Hi, I have this issue aswell but I'm confused how do I access the infiniteScroll outside the event emission to perform a reset?
sclausen commentedon Mar 22, 2016
@wieseljonas have a look at the sources you can simply store the passed InfiniteScroll to a member variable and then access it from outside of the event emission.
ciekawy commentedon Apr 10, 2016
@sclausen still this seems to be workaround. I wonder if there is any new issue regarding resetting infiniteScroll mentioned by @wieseljonas or should it be created?
sclausen commentedon Apr 11, 2016
@ciekawy I don't think it's needed, since @adamdbradley removed the highestY check, or does it still causes problems for you?
ciekawy commentedon Apr 11, 2016
will check it more deeply. I've found it not working and just added the reset by capturing to a member.