Calvin-LL / Reorderable

Reorder items in Lists and Grids in Jetpack Compose and Compose Multiplatform with drag and drop.
Apache License 2.0
484 stars 15 forks source link

Problem in the case of a lazy column with 3 large items #51

Closed mharam closed 1 month ago

mharam commented 1 month ago

Hi,

Thank you for this useful library. I encountered a problem with this library. When I have 3 items with large height in the LazyColumn that the third item lies partially outside the column height, then if I try to drag item #1 to place at item #0 the LazyColumn scrolls and I cannot complete the reordering process. In order to reproduce this condition change the items variable as follows:

val items = (0..2).map {
    Item(id = it, text = "Item #$it", size = if (it % 2 == 0) 270 else 400)
}

Then compile it on an 6'' phone emulator like Pixel 6a.

With regards

Calvin-LL commented 1 month ago

Can you provide a screen recording?

Calvin-LL commented 1 month ago

Might be related to https://github.com/Calvin-LL/Reorderable/issues/4#issuecomment-2107410640 and https://github.com/Calvin-LL/Reorderable/issues/46

mharam commented 1 month ago

Screen_recording_20240916_112540.webm

I'm not sure it's exactly related to the issues you mentioned. But it may be related to some extent.

Calvin-LL commented 1 month ago

Looks like it's related to #4, it should still work if you drag it all the way up. Give v2.4.0-beta01 a try, it has Compose Foundation v1.7.0 so it should work.

mharam commented 1 month ago

Android studio gives error: Failed to resolve: sh.calvin.reorderable:reorderable:v2.4.0-beta01 Chrome also gives 404 Not Found error!

Calvin-LL commented 1 month ago

Very strange. I did publish it https://central.sonatype.com/artifact/sh.calvin.reorderable/reorderable/versions

Calvin-LL commented 1 month ago

Oh it should be sh.calvin.reorderable:reorderable:2.4.0-beta01 without the "v"

mharam commented 1 month ago

Thank you so much. It now works perfectly!