How to refresh records in repeat without it auto scrolling back to top?

Whenever I refresh a database query the list of records in the repeat scrolls back to the top. Is there a way to keep it from returning to the top?

How are you refreshing the database query? PHP or Node?

I have the same question as Heather. How are you doing the refresh? I use schedulers on PHP and have no problem with page scrolling anywhere.

This is a Capacitor project. The refresh happens via a Flow that has a Capacitor SQLite Query action.

Technically, the whole page doesn’t scroll to top. It’s only the repeat region.

Ah, Capacitor project. Out of my league. Sorry. :frowning:

Here’s how I deal with this.

  • Load the dataset into a data store
  • When you refresh the server connect, use an upsert of all records (rather than clearing and inserting)
  • Point the repeat children to the data store
  • Use a key on the repeat children
  • Bonus tip…if using images that may be modified, include the url of the image in the key. If you don’t do this, the image won’t update if changed.

Depending on your complexity, a short cut may be to simply put a key on your repeat children that points to a server connect, but I can’t recall if that works or when it breaks down.

Thanks Ken! Are you doing this even with a SQLite db on the client?

Soooo, this seems like a bug. Stable channel doesn’t scroll.