From 3671d1dcde36f0474987ff639a304afd30b7f000 Mon Sep 17 00:00:00 2001 From: Jason Moon Date: Mon, 28 Oct 2019 09:58:33 -0600 Subject: [PATCH] =?UTF-8?q?Listen=20to=20window=E2=80=99s=20popstate=20eve?= =?UTF-8?q?nts=20for=20QS=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/search/instant-search/components/search-app.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/search/instant-search/components/search-app.jsx b/modules/search/instant-search/components/search-app.jsx index 3310773c87dd8..ad5d9ce6be830 100644 --- a/modules/search/instant-search/components/search-app.jsx +++ b/modules/search/instant-search/components/search-app.jsx @@ -58,9 +58,11 @@ class SearchApp extends Component { this.input.current.focus(); } + window.addEventListener( 'popstate', this.onChangeQueryString ); window.addEventListener( 'queryStringChange', this.onChangeQueryString ); } componentWillUnmount() { + window.removeEventListener( 'popstate', this.onChangeQueryString ); window.removeEventListener( 'queryStringChange', this.onChangeQueryString ); }