Skip to content

Commit

Permalink
fix(history-browser): Add location.href to replaceState() call
Browse files Browse the repository at this point in the history
There is currently a bug in Safari that doesn't properly handle the optional third parameter to the replaceState(state, title, url) function when a <base /> tag is present on the page. This fix explicitly sets the url property to the location.href value.

Thanks to @powerbuoy @huochunpeng and @jwx for helping diagnose this issue!

Closes #34 aurelia/router#574
  • Loading branch information
davismj committed Feb 9, 2018
1 parent b215008 commit 424c252
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export class BrowserHistory extends History {
setState(key: string, value: any): void {
let state = Object.assign({}, this.history.state);
state[key] = value;
this.history.replaceState(state, null, null);
this.history.replaceState(state, null, this.location.href);
}

/**
Expand Down

0 comments on commit 424c252

Please sign in to comment.