Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
ons-lazy-repeat : how to scroll to a desired list item?
peko last edited by peko
I was wondering if there’s any way to scroll the lazy repeat list to the same scrollTop position it was in before calling list.refresh()? The refresh() method scrolls the list back to scrollTop: 0, which I want to avoid.
Since the items are inserted into DOM dynamically, I can’t simply use the .scrollTop property of the item prior to calling list.refresh() - the item won’t exist in DOM after refresh, and it isn’t possible to scroll down that far.
refreshmethod shouldn’t scroll back to the top of the list. Are you able to reproduce that behaviour in the playground? https://onsen.io/playground/
You should be able to set it with the normal JS
scrollproperties but if need be I’ll be post a solution if you can reproduce it