-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
[4.0.0-beta.17] Angular's Location.back()
has no navigation animation
#16569
Comments
Related to #15181 |
+1 can confirm this also |
After updating to Beta 19 there is now no longer any type of animation when using |
Location.back()
uses forward navigation animationLocation.back()
has no navigation animation
I've worked around this by doing the following: // Provide the back animation.
this.navController.setDirection("back", true, "back");
this.location.back(); You can also use It was helpful to understand more about the role of the v4 I'm leaving this issue open in case anyone really wants Thanks! |
Issue number: resolves #16569 --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> Ionic Angular's routing integration disables page transitions when using the browser back/forward buttons. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Transitions now play when using the back/forward buttons ## Does this introduce a breaking change? - [ ] Yes - [x] No We're not aware of any breaking changes here, though it's possible some developers were relying on this behavior. As a result, we are targeting Ionic 8 to minimize any potential negative impact this fix may have on developers. <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> Supersedes #28188 Dev build: `7.5.6-dev.11700068172.15ce9b35` Co-authored-by: hoi4 <[email protected]>
Thanks for the issue. This has been resolved via #28530, and a fix will be available in the upcoming major release of Ionic. We opted to target this for Ionic 8 to minimize any impact that this change may have on developers who were relying on the old behavior. |
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. |
Bug Report
Ionic Info
Describe the Bug
Using Angular's
Location.back()
has no navigation animation instead of the back navigation animation.Steps to Reproduce
Steps to reproduce the behavior:
sidemenu
Angular stater template. You will need to switch to the custom-back-button branch.npm i
.ionic serve
.Toggle device toolbar
button to simulate a mobile device. From the device dropdown choose an iOS device such as an iPhone X.List
.Item 1
to forward navigate to the detail screen forItem 1
.Item 2
to forward navigate to the detail screen forItem 2
.Item 3
to forward navigate to the detail screen forItem 3
.Item 4
to forward navigate to the detail screen forItem 4
.ion-back-button
but is rather a similarly styled, customapp-back-button
component that, when you click it, usesimport { Location } from '@angular/common'
and does aLocation.back()
.ion-back-button
is stated in IonRouterOutlet.pop() doesn't properly update the browser navigation history #15428 (see this comment) and is also mentioned in Ionic 4 - StackController Page reuse uses old Page data #16516.Location.back()
to go back in the browser history stack.Related Code
A sample application has been provided. See the Steps to Reproduce above.
Expected Behavior
I expected that using Angular's
Location.back()
to navigate back in the browser's history stack would use the back navigation animation instead of no navigation animation.Additional Context
See the Steps to Reproduce above for the rationale for using a custom Back button and the related GitHub issues. This behavior change was introduced in Beta 17--perhaps related to fixing #16367.
FWIW, using the Android back button does seem to animate appropriately as does the
ion-back-button
. The browser back/forward buttons have no navigation animation but that seems appropriate given that it's in a browser context.Thanks again for all that you do in making a great framework! 😀
The text was updated successfully, but these errors were encountered: