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
feat: Disabling Animation on NavController#pop via options argument #20586
Comments
Thanks for the feature request. The stack does not manage running the animations, so I do not think it would make sense for the If you need to use import { NavController, IonRouterOutlet } from '@ionic/angular';
...
goBack() {
this.routerOutlet.nativeEl.animated = false;
this.navCtrl.pop();
}
ionViewDidLeave() {
this.routerOutlet.nativeEl.animated = true;
} Ideally, you would be able to use |
@liamdebeasi Yes this does work thank you. I however had to use |
Ah sorry, I forgot |
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. |
Feature Request
Adding the ability to disable
NavController#pop
via an options object, this was allowed previously in Ionic v3 but is missing in Ionic v4. Here is a very elaborate analysis of this issue that I have posted on your alls forums with links to the source code. Post FollowsLooks like in the new Ionic v4 the options for disabling animation when using
has unfortunately been removed. However in the source code of the StackController in its implementation of pop which is called via
NavController
s pop the framework will eventually usenavigateBackward
and will pass in the view.savedExtras which should allow someone to disable this pop animation. However theseRouteViews
are created via this controller and are not given an option to be created with these savedExtrasAND unfortunately I am unable to directly inject the
StackController
into my class to perform this logic myself. Does anyone have a solution here to perform this? I am unable to directly usenavigateBackward
because in edge cases another view is navigated to from this page and added to the history and I don't want to go back in the history but back in the stack.Thanks.
Ionic version:
[x] 4.x
Describe the Feature Request
Add pop options to the NavController like in Ionic v3 so we can disable animation on only a single pop and not via the whole app
Describe Preferred Solution
being able to pass in options to NavController.pop to modify the animations just like in navigateBackward(which is eventually called via the pop method)
Related Code
Ionic v3 link above has the feature request code
The text was updated successfully, but these errors were encountered: