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

Abstract state resets history #2843

Closed
khashayar opened this issue Jan 3, 2015 · 5 comments
Closed

Abstract state resets history #2843

khashayar opened this issue Jan 3, 2015 · 5 comments
Assignees
Milestone

Comments

@khashayar
Copy link

I have an abstract state with two sub-states. On beta 13, everything works perfectly. When I switch to this state, it changes with animation, shows me the back button & keeps the history. After upgrading to beta 14, when I navigate to this state, no transition animation happens & back button wouldn't show up. If I comment the abstract: true on the state definition, again it works as before with no problem!

I tried to track it down and found following condition, where there's a special check for abstract states and set the direction to none:
https://github.com/driftyco/ionic/blob/4130c5a1c3db8a8061d18c7699621234a752568a/js/angular/service/history.js#L288

Is this change of behavior on abstract states intentional?

@felquis
Copy link

felquis commented Jan 3, 2015

I have the same problem, I created a codepen to reproduce the problem and how to reproduce, I posted in the forum http://forum.ionicframework.com/t/problem-with-transition-between-abstract-views/14402

@sgandon
Copy link

sgandon commented Jan 3, 2015

I have the same problem and also realized that removing the abstract:true made it work but I am not sure this is a valid workaround.

@adamdbradley
Copy link
Contributor

An abstract state isn't its own view, but a container for views. As in, it doesn't have it's own URL to go to.

This is kind of related to the back button too. When you have 2 tabs, you cannot use the back button to switch between tabs, rather, it only goes "back" in the same tab, or history. When you're using abstract states, you're giving it a new history stack for all of those views, but the back button is only for that history stack.

If you do need the back button to work between histories I would first recommend a different structure. However, I will try to think of better ways to handle your scenario, as it's a common problem. Thanks

@MarcWadai
Copy link

I would like to know like @sgandon mention. If we remove the abstract attributes it works. But is it a valid/correct workaround if the implementation and design can't be change ?
Thx !

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 3, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants