Monaca Onsen UI Discord Chat Github Repo

ons-lazy-repeat from bottom



  • HI.
    Is there a way to create ons-lazy-repeat list scrolling from bottom to top?
    At this moment ons-lazy-repeat list starts always from first element and scrolls to last. Is there a way to start from end of the list? To scroll up like messenger

    Moreover, Is there a way to make immediate scroll to specific item index? Like changing scrollTop. (Changing scrollTop not works)


  • administrators

    @sandidro said in ons-lazy-repeat from bottom:

    HI.
    Is there a way to create ons-lazy-repeat list scrolling from bottom to top?
    At this moment ons-lazy-repeat list starts always from first element and scrolls to last. Is there a way to start from end of the list? To scroll up like messenger

    ons-lazy-repeat doesn’t support scrolling from bottom to top. It does sound like this could be a useful feature. If you think it would be, I can create a GitHub issue to put it into consideration.

    Moreover, Is there a way to make immediate scroll to specific item index? Like changing scrollTop. (Changing scrollTop not works)

    scrollTop should work if you call it on the .page__content e.g. document.querySelector('.page__content').scrollTop = //whatever.



  • @emccorson said in ons-lazy-repeat from bottom:

    page__content

    I mean scrollTop doesn’t work for ons-lazy-repeat.
    It seems there is no way to scroll ons-lazy-repeat list to some position or bottom


  • administrators

    Are you talking about scrolling to items that are currently in the DOM? In that case, scrollTop should work fine as long as you know the height of your items so you can figure out the position of the item you want to scroll to.

    If you want to scroll to an item that has not yet been loaded or has been re-hidden by the lazy list, that might be a bit more tricky.