mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Canvas: Fix selecto breaking on enter / exit panel edit mode (#48387)
This commit is contained in:
@@ -113,17 +113,16 @@ export class CanvasPanel extends Component<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// After editing, the options are valid, but the scene was in a different panel or inline editing mode has changed
|
// After editing, the options are valid, but the scene was in a different panel or inline editing mode has changed
|
||||||
const shouldUpdateSceneAndPanel =
|
const shouldUpdateSceneAndPanel = this.needsReload && this.props.options !== nextProps.options;
|
||||||
(this.needsReload && this.props.options !== nextProps.options) ||
|
const inlineEditingSwitched = this.props.options.inlineEditing !== nextProps.options.inlineEditing;
|
||||||
this.props.options.inlineEditing !== nextProps.options.inlineEditing;
|
if (shouldUpdateSceneAndPanel || inlineEditingSwitched) {
|
||||||
if (shouldUpdateSceneAndPanel) {
|
|
||||||
this.needsReload = false;
|
this.needsReload = false;
|
||||||
this.scene.load(nextProps.options.root, nextProps.options.inlineEditing);
|
this.scene.load(nextProps.options.root, nextProps.options.inlineEditing);
|
||||||
this.scene.updateSize(nextProps.width, nextProps.height);
|
this.scene.updateSize(nextProps.width, nextProps.height);
|
||||||
this.scene.updateData(nextProps.data);
|
this.scene.updateData(nextProps.data);
|
||||||
changed = true;
|
changed = true;
|
||||||
|
|
||||||
if (this.props.options.inlineEditing) {
|
if (inlineEditingSwitched && this.props.options.inlineEditing) {
|
||||||
this.scene.selecto?.destroy();
|
this.scene.selecto?.destroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user