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

fix(nav): custom animation is no longer overridden #23779

Merged

Conversation

MarkChrisLevy
Copy link
Contributor

opts will always have animationBuilder prop when used with ion-router and this fix will make sure, that animationBuilder will be set with appropriate value

Pull request checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)
  • Build (npm run build) was run locally and any changes were pushed
  • Lint (npm run lint) has passed locally and any fixes were made for failures

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: #23777

What is the new behavior?

Use custom transition if set on ion-nav and page change triggered by ion-router.

Does this introduce a breaking change?

  • Yes
  • No

Other information

opts will always have animationBuilder prop when used with ion-router and this fix will make sure, that animationBuilder will be set with appropriate value
@github-actions github-actions bot added the package: core @ionic/core package label Aug 17, 2021
@liamdebeasi liamdebeasi changed the title fix(ion-nav): use custom transition fix(nav): custom animation is no longer overridden Aug 17, 2021
Copy link
Contributor

@liamdebeasi liamdebeasi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! This is good to merge when tests pass.

...opts
...opts,

animationBuilder: opts.animationBuilder || this.animation || config.get('navAnimation')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why we switched the order here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Transition passed in opts (e.g. it came from router) should take precedence over nav transition. Simple example - I set transition for nav, but in specific scenario, when moving from view A to B I need other transition, which can be passed to push() or set in router-link. Previous impl would always pick nav's transition.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@liamdebeasi liamdebeasi merged commit f9415ef into ionic-team:main Aug 18, 2021
@liamdebeasi
Copy link
Contributor

Merged. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants