Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
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
- 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],
})
- Add an component with a date presentation
<ion-datetime
presentation="date"
displayFormat="DD-MM-YYYY"
>
</ion-datetime>
- 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
ionic-framework/core/src/components/datetime/datetime.tsx
Lines 1478 to 1482 in c3ad15b