Open noradium opened 1 year ago
Hello,
I found the bug that createBrowserHistory() breaks URL in history on iOS 11 (or below) safari.
(Suppose following path was on https://example.com)
/pageA
/pageB
<base href="https://example.com">
/pageC
back to /pageB
back to /
/
This behavior is probably due to webkit bug. (Bug 182678: replaceState cause back/forward malfunction on html page with tag)
replaceState without 3rd argument at https://github.com/remix-run/history/blob/dev/packages/history/index.ts#L439 causes.
There is a workaround to pass current URL like this.
globalHistory.replaceState({ ...globalHistory.state, idx: index }, "", createHref(location));
I confirmed that it fixed the issue.
May I make a PR?
Thank you.
Hello,
I found the bug that createBrowserHistory() breaks URL in history on iOS 11 (or below) safari.
Steps to reproduce
(Suppose following path was on https://example.com)
/pageA
(not call createBrowserHistory)/pageB
(from link in pageA / has<base href="https://example.com">
tag / call createBrowserHistory)/pageC
(from link in pageB)Expected Behavior
back to
/pageB
Actual Behavior
back to
/
My Thought
This behavior is probably due to webkit bug. (Bug 182678: replaceState cause back/forward malfunction on html page with tag)
replaceState without 3rd argument at https://github.com/remix-run/history/blob/dev/packages/history/index.ts#L439 causes.
There is a workaround to pass current URL like this.
I confirmed that it fixed the issue.
May I make a PR?
Thank you.