Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: fix incorrect nav animations #28297

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

Open
hoi4 wants to merge 10 commits into ionic-team:main
base: main
Choose a base branch
Loading
from hoi4:fix-incorrect-nav-animations

Conversation

Copy link
Contributor

@hoi4 hoi4 commented Oct 6, 2023
edited
Loading

This PR is a follow-up to #28188.

Respective issue: #28307

It fixes an issue where the nav animation is sometimes incorrect when using the browser back and forward buttons to navigate through multiple pages.
The last nav animation in the following video should be forward, but is back instead.

Screen.Recording.2023年10月06日.at.08.29.22.mov

Angular's navigation ids are not a reliable solution because Angular does not reuse navigations.
From the docs:

From the perspective of the router, the router never "goes back". When the user clicks on the back button in the browser, a new navigation ID is created.

Solution

Ionic already manages a navigation stack internally. Instead of "guessing" the nav animation direction based on Angular's router navigation ids, we can use the navigation stack to derive the required nav animation.

Recording with my changes:

Screen.Recording.2023年10月06日.at.08.41.26.mov

Does this introduce a breaking change?

  • Yes
  • No

@github-actions github-actions bot added the package: angular @ionic/angular package label Oct 6, 2023
Copy link
Contributor Author

hoi4 commented Oct 6, 2023

FYI, @liamdebeasi :)

Copy link
Contributor

Hey @hoi4,

Thanks for making a separate PR! Does this PR already have an associated issue? If so, can you please link it in the PR template? If not, could you please make one and include a reproduction?

Copy link
Contributor Author

hoi4 commented Oct 9, 2023

@liamdebeasi issue created and linked ✅

@hoi4 hoi4 force-pushed the fix-incorrect-nav-animations branch from 9363056 to c8370d9 Compare October 31, 2023 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@thetaPC thetaPC Awaiting requested review from thetaPC

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
package: angular @ionic/angular package
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /