mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Stack Monitoring] Fix hashchange detection on sidenav link (#114727)
This commit is contained in:
parent
fdc0ce749a
commit
da8264f26a
1 changed files with 8 additions and 1 deletions
|
@ -59,9 +59,15 @@ import { LogStashNodePipelinesPage } from './pages/logstash/node_pipelines';
|
|||
export const renderApp = (
|
||||
core: CoreStart,
|
||||
plugins: MonitoringStartPluginDependencies,
|
||||
{ element, setHeaderActionMenu }: AppMountParameters,
|
||||
{ element, history, setHeaderActionMenu }: AppMountParameters,
|
||||
externalConfig: ExternalConfig
|
||||
) => {
|
||||
// dispatch synthetic hash change event to update hash history objects
|
||||
// this is necessary because hash updates triggered by using popState won't trigger this event naturally.
|
||||
const unlistenParentHistory = history.listen(() => {
|
||||
window.dispatchEvent(new HashChangeEvent('hashchange'));
|
||||
});
|
||||
|
||||
ReactDOM.render(
|
||||
<MonitoringApp
|
||||
core={core}
|
||||
|
@ -74,6 +80,7 @@ export const renderApp = (
|
|||
|
||||
return () => {
|
||||
ReactDOM.unmountComponentAtNode(element);
|
||||
unlistenParentHistory();
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue