Skip to content

Canceled Location.forward() breaks history #15664

Closed

Description

@DzmitryShylovich

I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting

Current behavior
When CanDeactivate cancels Location.forward() routing history is 1 item ahead.
Workflow

Home -- navigate to     --> Child 1
Child 1 -- navigate to     --> Child 2
Child 2 -- navigate to     --> Child 3 (CanDeactivate returned true)
Child 3 -- location.back() --> Child 2
Child 2 --  location.forward() --> Child 2 (navigation canceled CanDeactivate returned false)
Child 2 -- location.back() --> Child 2 (should be Route 1)

Expected behavior

Home -- navigate to     --> Child 1
Child 1 -- navigate to     --> Child 2
Child 2 -- navigate to     --> Child 3 (CanDeactivate returned true)
Child 3 -- location.back() --> Child 2
Child 2 --  location.forward() --> Child 2 (navigation canceled CanDeactivate returned false)
Child 2 -- location.back() --> Child 1 (expected)

Minimal reproduction of the problem with instructions
http://plnkr.co/edit/PbKRj7v1B1tRVXRSrEup?p=preview

  1. Click button Child1
  2. Click button Child2
  3. Click button Child3
  4. Click button Back
  5. Click button Forward
  6. Click button Back

Expected behavior is to see Child1 but it's still Child2

Activity

  1. patrickracicot commented on Oct 25, 2017

    @patrickracicot

    Any progress on this issue? The PR #18135 for the referenced issue #18135 is still pending and the frequency seems to be bigger then initialy estimated.

  2. added this to the Backlog milestone on Jan 23, 2018
  3. atscott commented on May 26, 2020

    @atscott
    Contributor

    Confirmed and marking as duplicate of #13586. Example in #13586 (comment) extended to include this use-case.

  4. angular-automatic-lock-bot commented on Jun 27, 2020

    @angular-automatic-lock-bot

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  5. locked and limited conversation to collaborators on Jun 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions