diff --git a/.betterer.results b/.betterer.results index cc518c88749..9f3f66138d7 100644 --- a/.betterer.results +++ b/.betterer.results @@ -4581,7 +4581,7 @@ exports[`better eslint`] = { "public/app/features/canvas/runtime/root.tsx:2845174121": [ [24, 19, 36, "Do not use any type assertions.", "1413431594"] ], - "public/app/features/canvas/runtime/scene.tsx:2490140997": [ + "public/app/features/canvas/runtime/scene.tsx:4285479205": [ [155, 61, 25, "Do not use any type assertions.", "588553285"], [160, 42, 25, "Do not use any type assertions.", "588553285"] ], @@ -10980,10 +10980,9 @@ exports[`better eslint`] = { [41, 64, 3, "Unexpected any. Specify a different type.", "193409811"], [41, 69, 3, "Unexpected any. Specify a different type.", "193409811"] ], - "public/app/plugins/panel/canvas/editor/LayerElementListEditor.tsx:2866351070": [ + "public/app/plugins/panel/canvas/editor/LayerElementListEditor.tsx:374041207": [ [21, 33, 3, "Unexpected any. Specify a different type.", "193409811"], - [40, 30, 44, "Do not use any type assertions.", "712744497"], - [50, 20, 3, "Unexpected any. Specify a different type.", "193409811"] + [40, 30, 44, "Do not use any type assertions.", "712744497"] ], "public/app/plugins/panel/canvas/editor/PlacementEditor.tsx:1494111960": [ [33, 53, 3, "Unexpected any. Specify a different type.", "193409811"] diff --git a/public/app/features/canvas/runtime/scene.tsx b/public/app/features/canvas/runtime/scene.tsx index d7ba359cfcc..d481950b742 100644 --- a/public/app/features/canvas/runtime/scene.tsx +++ b/public/app/features/canvas/runtime/scene.tsx @@ -394,8 +394,12 @@ export class Scene { this.moveable!.isMoveableElement(selectedTarget) || targets.some((target) => target === selectedTarget || target.contains(selectedTarget)); - if (isTargetMoveableElement) { - // Prevent drawing selection box when selected target is a moveable element + const isTargetAlreadySelected = this.selecto + ?.getSelectedTargets() + .includes(selectedTarget.parentElement.parentElement); + + if (isTargetMoveableElement || isTargetAlreadySelected) { + // Prevent drawing selection box when selected target is a moveable element or already selected event.stop(); } }).on('selectEnd', (event) => { diff --git a/public/app/plugins/panel/canvas/editor/LayerElementListEditor.tsx b/public/app/plugins/panel/canvas/editor/LayerElementListEditor.tsx index 0f4be613d12..2865f83f2a2 100644 --- a/public/app/plugins/panel/canvas/editor/LayerElementListEditor.tsx +++ b/public/app/plugins/panel/canvas/editor/LayerElementListEditor.tsx @@ -48,7 +48,7 @@ export class LayerElementListEditor extends PureComponent { layer.reinitializeMoveable(); }; - onSelect = (item: any) => { + onSelect = (item: ElementState) => { const { settings } = this.props.item; if (settings?.scene) {