Skip to content

[v2] can't reset ion-infinite-scroll #5677

Closed

Description

@sclausen

Short description of the problem:

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.

Ionic Version: [email protected]

Activity

  1. cmanou commented on Mar 11, 2016

    @cmanou

    Another option would be to remove the highestY, though that will impact performance.

  2. beerbohmdo commented on Mar 11, 2016

    @beerbohmdo

    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 TypeScriptUnresolvedVariable
                            this.infinite._highestY = 0;
                            //noinspection TypeScriptUnresolvedVariable
                            this.infinite._lastCheck = 0;
  3. adamdbradley commented on Mar 12, 2016

    @adamdbradley
    Contributor

    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!

  4. self-assigned this
    on Mar 12, 2016
  5. added this to the 2.0.0-beta.4 milestone on Mar 12, 2016
  6. wieseljonas commented on Mar 22, 2016

    @wieseljonas

    Hi, I have this issue aswell but I'm confused how do I access the infiniteScroll outside the event emission to perform a reset?

  7. sclausen commented on Mar 22, 2016

    @sclausen
    ContributorAuthor

    @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.

  8. ciekawy commented on Apr 10, 2016

    @ciekawy
    Contributor

    @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?

  9. sclausen commented on Apr 11, 2016

    @sclausen
    ContributorAuthor

    @ciekawy I don't think it's needed, since @adamdbradley removed the highestY check, or does it still causes problems for you?

  10. ciekawy commented on Apr 11, 2016

    @ciekawy
    Contributor

    will check it more deeply. I've found it not working and just added the reset by capturing to a member.

  11. locked and limited conversation to collaborators on Sep 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions