ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
50.97k stars 13.51k forks source link

IonicModule.forRoot(getConfig()) navAnimation not working on v5.2 #21495

Closed eun-choi closed 4 years ago

eun-choi commented 4 years ago

IonicModule.forRoot(getConfig()) setting in app.module.ts

It works fine until 5.1.1 version. But, It doesn't work after 5.2 version update.

There was no breaking change guide, it seems like a bug.

[More information] I was created a custom animation in the navAnimation config and it worked fine from 5.0.0 to 5.1.1 I think that it was affected by animation changes related to #21433

It was a very good idea to change the animations that can be set for per page. But, I think that adding custom animation to global settings should work by default.

ionitron-bot[bot] commented 4 years ago

Thanks for the issue! This issue has been labeled as needs reproduction. This label is added to issues that need a code reproduction.

Please provide a reproduction with the minimum amount of code required to reproduce the issue. Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed.

For a guide on how to create a good reproduction, see our Contributing Guide.

eun-choi commented 4 years ago

[More information] I was created a custom animation in the navAnimation config and it worked fine from 5.0.0 to 5.1.1 I think that it was affected by animation changes related to https://github.com/ionic-team/ionic/pull/21433

It was a very good idea to change the animations that can be set for per page. But, I think that adding custom animation to global settings should work by default.

[app.module.ts Code]

import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { IonicConfig, Animation, NavOptions, createAnimation, isPlatform } from '@ionic/core';
const ani = (_el: HTMLElement, opts: TransitionOptions): Animation => {};
// The detailed values ​​of the custom animation are omitted.
const getConfig = () => {
  let config: IonicConfig = {
    animated: true,
    navAnimation: ani, // Custom nav animation for global.
    backButtonText: '',
    rippleEffect: false
  };
  if (isPlatform('android')) {
    config = {
      ...config,
      hardwareBackButton: true,
      swipeBackEnabled: false,
      backButtonIcon: 'arrow-back'
    };
  } else if (isPlatform('ios')) {
    config = {
      ...config,
      hardwareBackButton: false,
      swipeBackEnabled: true,
      backButtonIcon: 'chevron-back'
    };
  }
  return config;
};
@NgModule({
  declarations: [AppComponent],
  entryComponents: [],
  imports: [
    BrowserModule,
    IonicModule.forRoot(getConfig()),
    AppRoutingModule,

[Working Environment]

   Ionic CLI                     : 6.10.0 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.1.1
   @angular-devkit/build-angular : 0.901.8
   @angular-devkit/schematics    : 9.1.8
   @angular/cli                  : 9.1.8
   @ionic/angular-toolkit        : 2.2.0

[Troubled Environment]

   Ionic CLI                     : 6.10.0 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.2.0
   @angular-devkit/build-angular : 0.901.8
   @angular-devkit/schematics    : 9.1.8
   @angular/cli                  : 9.1.8
   @ionic/angular-toolkit        : 2.2.0
liamdebeasi commented 4 years ago

Thanks for the follow up. Can you try the following dev build and let me know if it resolves the issue?

npm i @ionic/angular@5.3.0-dev.202006111707.7c8f621

eun-choi commented 4 years ago

npm i @ionic/angular@5.3.0-dev.202006111707.7c8f621 After installing with the dev build, It works fine with custom animation settings in navAnimation!

liamdebeasi commented 4 years ago

Thanks for the issue. This has been resolved via https://github.com/ionic-team/ionic/pull/21508, and a fix will be available in the next release of Ionic Framework.

ionitron-bot[bot] commented 4 years ago

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.