From bc2ca8a976405006cca209d53fd1be0f29a3935f Mon Sep 17 00:00:00 2001 From: Jiri Kozel Date: Tue, 13 Feb 2018 15:10:59 +0100 Subject: [PATCH] Preserve history state when updating hash Current implementation replaces history state on every moveend with empty string. The purposed solution replaces state with current state instead of empty string. The reason for this is to let other code to use history state as it is usual for single page applications. --- src/ui/hash.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/hash.js b/src/ui/hash.js index 37052c6bb3b..5d005ccb80a 100644 --- a/src/ui/hash.js +++ b/src/ui/hash.js @@ -91,7 +91,7 @@ class Hash { _updateHashUnthrottled() { const hash = this.getHashString(); - window.history.replaceState('', '', hash); + window.history.replaceState(window.history.state, '', hash); } }