mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fixed issue with switching panels
This commit is contained in:
parent
0823712c9a
commit
42ee81a97c
@ -31,6 +31,10 @@ interface Props extends React.HTMLProps<HTMLInputElement> {
|
||||
}
|
||||
|
||||
export class Input extends PureComponent<Props> {
|
||||
static defaultProps = {
|
||||
className: '',
|
||||
};
|
||||
|
||||
state = {
|
||||
error: null,
|
||||
};
|
||||
|
@ -81,10 +81,10 @@ export class DashboardPanel extends PureComponent<Props, State> {
|
||||
}
|
||||
|
||||
if (plugin.exports) {
|
||||
this.setState({ plugin: plugin });
|
||||
this.setState({ plugin: plugin, angularPanel: null });
|
||||
} else {
|
||||
plugin.exports = await importPluginModule(plugin.module);
|
||||
this.setState({ plugin: plugin });
|
||||
this.setState({ plugin: plugin, angularPanel: null });
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -106,18 +106,15 @@ export class DashboardPanel extends PureComponent<Props, State> {
|
||||
this.setState({ angularPanel });
|
||||
}
|
||||
|
||||
cleanUpAngularPanel(unmounted?: boolean) {
|
||||
cleanUpAngularPanel() {
|
||||
if (this.state.angularPanel) {
|
||||
this.state.angularPanel.destroy();
|
||||
|
||||
if (!unmounted) {
|
||||
this.setState({ angularPanel: null });
|
||||
}
|
||||
this.element = null;
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
this.cleanUpAngularPanel(true);
|
||||
this.cleanUpAngularPanel();
|
||||
}
|
||||
|
||||
onMouseEnter = () => {
|
||||
|
Loading…
Reference in New Issue
Block a user