From c4e2b433865385b918a80b28246ed7b26ae9fb7b Mon Sep 17 00:00:00 2001 From: droc101 <37421449+droc101@users.noreply.github.com> Date: Wed, 17 Jun 2026 12:23:52 -0500 Subject: [PATCH] fix(datetime): respect config animated setting when paging month calendar replace hardcoded `behavior: 'smooth'` with either `'smooth'` or `'instant'` depending on the `animated` boolean config property, defaulting to `'smooth'` closes #30484 --- core/src/components/datetime/datetime.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/components/datetime/datetime.tsx b/core/src/components/datetime/datetime.tsx index f36cd66718d..ab9939504ae 100644 --- a/core/src/components/datetime/datetime.tsx +++ b/core/src/components/datetime/datetime.tsx @@ -8,6 +8,7 @@ import { isRTL } from '@utils/rtl'; import { createColorClasses } from '@utils/theme'; import { caretDownSharp, caretUpSharp, chevronBack, chevronDown, chevronForward } from 'ionicons/icons'; +import { config } from '../../global/config'; import { getIonMode } from '../../global/ionic-global'; import type { Color, Mode, StyleEventDetail } from '../../interface'; @@ -1555,10 +1556,11 @@ export class Datetime implements ComponentInterface { const left = (nextMonth as HTMLElement).offsetWidth * 2; + const scrollMode = config.getBoolean('animated', true) ? 'smooth' : 'instant'; calendarBodyRef.scrollTo({ top: 0, left: left * (isRTL(this.el) ? -1 : 1), - behavior: 'smooth', + behavior: scrollMode, }); }; @@ -1575,10 +1577,11 @@ export class Datetime implements ComponentInterface { const left = (prevMonth as HTMLElement).offsetWidth * 2; + const scrollMode = config.getBoolean('animated', true) ? 'smooth' : 'instant'; calendarBodyRef.scrollTo({ top: 0, left: left * (isRTL(this.el) ? 1 : -1), - behavior: 'smooth', + behavior: scrollMode, }); };