Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using {location: 'replace'} to go back to the previous state should pop history instead of creating two identical entries #1590

Closed
imgx64 opened this issue Nov 27, 2014 · 9 comments

Comments

@imgx64
Copy link

imgx64 commented Nov 27, 2014

Here's an example plunker (launch the preview in a separate window to see the history).

  1. The app starts at state0. History is /state0.
  2. Press the button to go to state1. History is /state0, /state0/state1.
  3. Press the button to go to state2. History is /state0, /state0/state1, /state0/state1/state2.
  4. Press the Go back button (which uses {location: 'replace'}) to go back to state1. History is now /state0, /state0/state1, /state0/state1, with duplicate /state0/state1.

I think a better behavior is to remove the duplicate state from history when this happens. The current behavior breaks the browser back button (now you have to click back twice to go back to state0).

@elitastic
Copy link

+1

@jvjvjv
Copy link

jvjvjv commented Mar 4, 2015

+2

@nateabele nateabele added this to the future milestone Mar 31, 2015
@nateabele
Copy link
Contributor

Our current handling of history is not very sophisticated. If you feel like working on a PR, let me know. Here, I already got you started: http://plnkr.co/edit/DJH6mQUCbTFfSbdCBYUo?p=preview

@mrtnjln
Copy link

mrtnjln commented Nov 9, 2015

Any news on this ?

@IainCole
Copy link

Should a state transition ever assume a "back" operation?

@bbaia
Copy link

bbaia commented Nov 10, 2015

+1

1 similar comment
@Clomo
Copy link

Clomo commented Nov 10, 2015

👍

@netsurferj
Copy link

👍

@stale
Copy link

stale bot commented Jan 24, 2020

This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs.

This does not mean that the issue is invalid. Valid issues
may be reopened.

Thank you for your contributions.

@stale stale bot added the stale label Jan 24, 2020
@stale stale bot closed this as completed Feb 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants