More precisely, I want to make it so that when I move an item that is below the currently visible portion of the list to the top, the current view and scroll position is maintained (so 1 2 [3 4 5] 6 7
becomes 6 1 2 [3 4 5] 7
instead of 6 1 [2 3 4] 5 6 7)
, []
denoting the current viewport).
React docs mention an iOS-exclusive maintainVisibleContentPosition
property that seems to achieve what I want, but there's no such property or option for Android. All the workarounds I've come up with so far, such as manually scrolling down after rearranging the list, or delaying the rearrangement until the user begins to scroll the list themselves, are very hacky and jittery.
Is there a better way to get what I want? Perhaps a different component/library implements this behavior?