mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Canvas: Fix inline edit toggle crash (#55961)
This commit is contained in:
parent
b0cd511ecc
commit
5a9dfd7173
@ -168,15 +168,16 @@ export class CanvasPanel extends Component<Props, State> {
|
|||||||
const shouldShowAdvancedTypesSwitched =
|
const shouldShowAdvancedTypesSwitched =
|
||||||
this.props.options.showAdvancedTypes !== nextProps.options.showAdvancedTypes;
|
this.props.options.showAdvancedTypes !== nextProps.options.showAdvancedTypes;
|
||||||
if (shouldUpdateSceneAndPanel || inlineEditingSwitched || shouldShowAdvancedTypesSwitched) {
|
if (shouldUpdateSceneAndPanel || inlineEditingSwitched || shouldShowAdvancedTypesSwitched) {
|
||||||
|
if (inlineEditingSwitched) {
|
||||||
|
// Replace scene div to prevent selecto instance leaks
|
||||||
|
this.scene.revId++;
|
||||||
|
}
|
||||||
|
|
||||||
this.needsReload = false;
|
this.needsReload = false;
|
||||||
this.scene.load(nextProps.options.root, nextProps.options.inlineEditing, nextProps.options.showAdvancedTypes);
|
this.scene.load(nextProps.options.root, nextProps.options.inlineEditing, nextProps.options.showAdvancedTypes);
|
||||||
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 (inlineEditingSwitched && this.props.options.inlineEditing) {
|
|
||||||
this.scene.selecto?.destroy();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
|
@ -32,7 +32,7 @@ export function getLayerEditor(opts: InstanceState): NestedPanelOptions<LayerEdi
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (element.parent) {
|
if (element && element.parent) {
|
||||||
scene.currentLayer = element.parent;
|
scene.currentLayer = element.parent;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user