diff --git a/public/app/features/canvas/runtime/group.tsx b/public/app/features/canvas/runtime/group.tsx index 91e1c6a6510..35d38155a90 100644 --- a/public/app/features/canvas/runtime/group.tsx +++ b/public/app/features/canvas/runtime/group.tsx @@ -77,7 +77,7 @@ export class GroupState extends ElementState { reinitializeMoveable() { // Need to first clear current selection and then re-init moveable with slight delay this.scene.clearCurrentSelection(); - setTimeout(() => this.scene.initMoveable(true), 100); + setTimeout(() => this.scene.initMoveable(true, this.scene.isEditingEnabled), 100); } // ??? or should this be on the element directly? diff --git a/public/app/features/canvas/runtime/scene.tsx b/public/app/features/canvas/runtime/scene.tsx index d16e63f89db..41db45e95a6 100644 --- a/public/app/features/canvas/runtime/scene.tsx +++ b/public/app/features/canvas/runtime/scene.tsx @@ -52,6 +52,7 @@ export class Scene { moveable?: Moveable; div?: HTMLDivElement; currentLayer?: GroupState; + isEditingEnabled?: boolean; constructor(cfg: CanvasGroupOptions, enableEditing: boolean, public onSave: (cfg: CanvasGroupOptions) => void) { this.root = this.load(cfg, enableEditing); @@ -86,6 +87,8 @@ export class Scene { this.save // callback when changes are made ); + this.isEditingEnabled = enableEditing; + setTimeout(() => { if (this.div) { // If editing is enabled, clear selecto instance @@ -165,7 +168,7 @@ export class Scene { if (updateMoveable) { setTimeout(() => { if (this.div) { - this.initMoveable(true); + this.initMoveable(true, this.isEditingEnabled); } }, 100); }