Repository navigation
fix(router): don't break history when CanDeactivate cancel back navigation - #13922
DzmitryShylovich wants to merge 1 commit into
Conversation
|
@vicb Review when you get a chance. |
|
@DzmitryShylovich could toy please rebase the PR ? |
There was a problem hiding this comment.
why is this removed ?
I don't think it relates to the issue ?
There was a problem hiding this comment.
there're no unit tests for this so I'm not sure what uses cases it covers
There was a problem hiding this comment.
What if was the forward button ?
|
@vicb rebased
if
does it make sense? the biggest problem is to figure out when back/forward button is called |
|
Fixed moved to #18135 |
|
feel sad for problem remained on 4.3 |
|
This issue is it fixed ? |
|
Does not seem like it is #13586 (comment) |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Closes ##13586
Description:
location.back()is called before router so there's no way to prevent if whenCanDeactivatereturnfalse.To maintain proper history we need to push (
location.pushState) new entry into the history instead of replacing (location.replaceState) the current entry.History before the fix
After the fix
TLTR our goal: we need to call
location.pushStateinstead oflocation.replaceStatewhenCanDeactivatecancelsbacknavigationhttp://plnkr.co/edit/GMkEl74JkQiRPMv6Km5Z?p=preview