@igo2/geo 21.0.0-next.46 → 21.0.0-next.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12842,18 +12842,16 @@ class LayerListComponent {
12842
12842
  if (controller.hasSelection) {
12843
12843
  nodesToDrop = controller.selected;
12844
12844
  }
12845
- if (isLayerGroup(node)) {
12846
- nodesToDrop = nodesToDrop.filter((nodeDrop) => !node.isDescendant(nodeDrop));
12847
- }
12848
- if (isLayerGroup(ref)) {
12849
- const isSelected = nodesToDrop.some((nodeDrop) => nodeDrop.id === ref.id);
12850
- if (isSelected) {
12851
- nodesToDrop = nodesToDrop.filter((nodeDrop) => nodeDrop.id !== ref.id);
12852
- }
12853
- }
12854
- if (!nodesToDrop.includes(node)) {
12845
+ nodesToDrop = nodesToDrop.filter((nodeDrop) => nodeDrop.id !== ref.id &&
12846
+ (!isLayerGroup(nodeDrop) || !nodeDrop.isDescendant(ref)));
12847
+ if (!nodesToDrop.includes(node) &&
12848
+ (!isLayerGroup(node) || !node.isDescendant(ref))) {
12855
12849
  nodesToDrop.push(node);
12856
12850
  }
12851
+ const selectedGroups = nodesToDrop.filter(isLayerGroup);
12852
+ if (selectedGroups.length) {
12853
+ nodesToDrop = nodesToDrop.filter((nodeDrop) => !selectedGroups.some((group) => group.isDescendant(nodeDrop)));
12854
+ }
12857
12855
  switch (position) {
12858
12856
  case 'above':
12859
12857
  controller.moveAbove(ref, ...nodesToDrop);