Draggable Frame inside UIListLayout

Is there a way to make a frame draggable so that I can exchange their position inside UIListLayout? thanks!

like let’s say
1-2-3-4-5 becoming 1-2-3-5-4, I drag frame with name 4 and exchange place with 5.

thanks!

One not easy way to do this with UIListLayout is ditching UIListLayout and code the dragging and the alignment manually. (This is fine too)

One way I otherwise can think of is to pull the frame outside the GUI object containing the UIListLayout and dragging it then when you stop dragging, reinsert it back into the GUI object with the UIListLayout. If the frame is the same size as that GUI object, this may make it easier for you.

Both ways however require you code the dragging part which you can find resources on. You’ll need to get the location of the mouse/drag touch and continuously move the frame while dragging to get this effect. If you’re trying to do some sort of shelf rearrangement, you’ll have to do a little bit of position math to see where the frame landed to make the frame arrangement.