Stackable list with database order is jumping around (Realtime)

Hi,

This is probably some design issue on my part, but maybe someone has an idea.
I’m having a stackable list which keeps indexes in the database. The list is realtime (Supabase).

Upon moving an element, it runs a loop of updating the indexes, and in this time the objects jump around. Understandably because of the loop taking some time.

What would be the best way to solve this while still retaining realtime?