In the layer list, is there a way to limit the drag-drop of layers so that they can only be reordered within their current group and not moved to another group?
I'm using the arcgis-layer-list component from version 4.33 of the SDK. I have use cases where we are adding multiple groups of feature layers to a map. I would like to limit the movability (dragging and dropping, reordering, etc.) of the list items to within the current group only. So, if I have groups A, B, and C, each of which contain layers 1, 2, and 3, I want to be able to reorder A-1, A-2, A-3 within group A, but not move them into either of the other groups, or to the top level of the list. Similarly, I want to be able to reorder groups A, B, and C at the top level of the layer list (so maybe they are in C, A, B order), but not drag any group into one of the other groups.
I have come up with a very hacky solution to intercept DOM drag events, determine whether the dragged item was dropped into a different parent, and if so, restore a snapshot of the layers from before the drag. However, even though this 'works', I then noticed that clicking on the drag handle for any item in the list opens a menu that allows me to 'Reorder' it (Move Up, Move Down), which is what I want, but also to 'Move To' any of the other groups, which I don't want.
Is there any straightforward way to accomplish this with the API as-is?