Closed erwin2848 closed 2 months ago
Latest commit: 1be7cc9a0777c2fa2b65fe41203e54dc66165d01
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
The useBeforeLeave feature hacks around the fact that u can't prevent browser back/forward navigation, using window.history.go(-1 or 1) to counter the initial direction and go back.
During development I found that window.history.go() can't be called too many times at once or else it doesn't navigate at all.
This behaviour causes a bug when using e.preventDefault() and e.retry(true) together (it changes the url the first time but doesn't render, after this the depth property in the history state is inaccurate and causes further breakage.
Adding a small delay like this would prevent this particular thing from happening.