You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make two lists: [1, 2, 3, 10], and [1,2,3,4,5,6,7,8,9,10], and be sure to assign keys. Note: no more than 5 items should be on screen at the same time in that case, such that you have to scroll more than 3 items to reach the end.
Grab item 10 from the first list, like this: [1, 2, 3, <10>]
In response to isAnyItemDragged, recompose the LazyColumn with the second list: [1,2,3,4,5,6,7,8,9,<10>]
For one-two frames, the item 10 ends up out of the LazyColumn's visible item list.
The dragged item goes out of the composition, the dragged state resets for the item, the item snaps back to its original position, isAnyItemDragged becomes false, and the list snaps back to [1,2,3,10] (no item dragged now).
To solve this, we need to persist the dragged item under the finger and its drag state, even if it would go out of composition when it became dragged (because the item was under the finger the whole time, it should stay on screen).
My use-case is that I want to reorder a list of items, where some items are hidden until I start reordering. For a brief moment during the gesture, the items must appear as soon as I start a drag, and disappear when I finish it.