From 4de3c3c50fba7e2e3e0b7dfba5b74a63af749295 Mon Sep 17 00:00:00 2001 From: igoradamenko Date: Sat, 26 May 2018 19:12:13 +0300 Subject: [PATCH] add hashchange listener --- web/app/components/root/root.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/app/components/root/root.jsx b/web/app/components/root/root.jsx index 12543a96..7eeb1fb8 100644 --- a/web/app/components/root/root.jsx +++ b/web/app/components/root/root.jsx @@ -70,6 +70,7 @@ export default class Root extends Component { }); setTimeout(this.checkUrlHash); + window.addEventListener('hashchange', this.checkUrlHash); }); } @@ -80,7 +81,7 @@ export default class Root extends Component { if (comment) { setTimeout(() => { comment.scrollIntoView(); - window.scrollTo(window.scrollX, 0); // sometimes smth goes wrong and iframe scrolls; we return it here + window.scrollTo(window.scrollX, 0); // sometimes smth goes wrong and iframe scrolls; we return it back }, 500); } }