Skip to content

Commit 23bfa08

Browse files
author
Margo Kopli
committed
fix(errors): added check if IE11 then use hashchange event listener Fixes vuejs#1849
1 parent 9e78ca2 commit 23bfa08

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/history/hash.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ export class HashHistory extends History {
2828
setupScroll()
2929
}
3030

31-
window.addEventListener(supportsPushState ? 'popstate' : 'hashchange', () => {
31+
const ua = window.navigator.userAgent
32+
const ie11 = ua.indexOf('rv:11.0') !== -1
33+
34+
window.addEventListener(supportsPushState && !ie11 ? 'popstate' : 'hashchange', () => {
3235
const current = this.current
3336
if (!ensureSlash()) {
3437
return

0 commit comments

Comments
 (0)