From f351efa7dc376b1cf3449d313f2eb08db2e40668 Mon Sep 17 00:00:00 2001 From: James Gowdy Date: Tue, 5 Feb 2019 14:51:20 +0000 Subject: [PATCH] [ML] Fixing the unmounting jobs list react component on page change (#29980) --- x-pack/plugins/ml/public/jobs/jobs_list/directive.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/x-pack/plugins/ml/public/jobs/jobs_list/directive.js b/x-pack/plugins/ml/public/jobs/jobs_list/directive.js index f02bd920529ea..0a8645710a48c 100644 --- a/x-pack/plugins/ml/public/jobs/jobs_list/directive.js +++ b/x-pack/plugins/ml/public/jobs/jobs_list/directive.js @@ -49,6 +49,11 @@ module.directive('jobsPage', function () { , element[0] ); + + element.on('$destroy', () => { + ReactDOM.unmountComponentAtNode(element[0]); + scope.$destroy(); + }); } }; });