mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Graph: Fix bug with showing/hiding the legend (#68774)
* don't unmount the root when hiding the legend * update comment
This commit is contained in:
parent
d4df5e0519
commit
0b6c5722a5
@ -136,9 +136,14 @@ class GraphElement {
|
||||
|
||||
if (!this.panel.legend.show) {
|
||||
if (this.legendElem.hasChildNodes()) {
|
||||
this.legendElemRoot.unmount();
|
||||
this.legendElemRoot.render(null);
|
||||
}
|
||||
this.renderPanel();
|
||||
// we need to wait for react to finish rendering the legend before we can render the graph
|
||||
// this is a slightly worse version of the `renderCallback` logic we use below
|
||||
// the problem here is there's nothing to pass a `renderCallback` to since we don't want to render the legend at all.
|
||||
setTimeout(() => {
|
||||
this.renderPanel();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user