ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

bug: calendar ignores IonicConfig.animated

Open wouterverweirder opened this issue 5 months ago • 0 comments

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

Switching between months in the calendar component is always happening with an animation, even if you have turned off animations in your application.

Expected Behavior

Switching to a month should happen without an animation.

Steps to Reproduce

  1. Disable animations on the root component or application
@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, IonicModule.forRoot({
    animated: false // Disable animations globally
  }), AppRoutingModule],
  providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }],
  bootstrap: [AppComponent],
})
  1. Add an component with a date presentation
<ion-datetime
  presentation="date"
  displayFormat="DD-MM-YYYY"
>
</ion-datetime>
  1. Switch between months. The new month slides in, even with animations turned off.

Code Reproduction URL

https://github.com/wouterverweirder/calendar-animation-bug

Ionic Info

Ionic:

Ionic CLI : 5.4.16 (/Users/wouter/.npm/_npx/864a9e3c2cd0cf50/node_modules/ionic) Ionic Framework : not installed @angular-devkit/build-angular : 19.2.15 @angular-devkit/schematics : 19.2.15 @angular/cli : 19.2.15 @ionic/angular-toolkit : 12.2.0

Capacitor:

Capacitor CLI : 7.3.0 @capacitor/core : 7.3.0

Utility:

cordova-res : not installed native-run : 2.0.1

System:

NodeJS : v20.19.0 (/Users/wouter/.nvm/versions/node/v20.19.0/bin/node) npm : 10.8.2 OS : macOS Unknown

Additional Information

Looks like the scrollTo code needs to be adjusted https://github.com/ionic-team/ionic-framework/blob/c3ad15b0bf30fa8af1f8605962dca6e3f76e6fb3/core/src/components/datetime/datetime.tsx#L1478-L1482

wouterverweirder avatar Jun 14 '25 08:06 wouterverweirder