diff --git a/core/src/components.d.ts b/core/src/components.d.ts index 1cd7c27747..1c066820bd 100644 --- a/core/src/components.d.ts +++ b/core/src/components.d.ts @@ -819,7 +819,7 @@ export namespace Components { } interface IonDatetime { /** - * Emits the ionCancel event and optionally closes the popover or modal that the datetime was presented in. + * The cancel method performs the following actions: 1. Emits the ionCancel event 2. Resets the internal state of the datetime 3. Closes the parent popover or modal if "closeOverlay" is true. */ "cancel": (closeOverlay?: boolean) => Promise; /** diff --git a/core/src/components/datetime/datetime.tsx b/core/src/components/datetime/datetime.tsx index fb5f5dc533..4783efbd04 100644 --- a/core/src/components/datetime/datetime.tsx +++ b/core/src/components/datetime/datetime.tsx @@ -546,7 +546,7 @@ export class Datetime implements ComponentInterface { */ @Method() async reset(startDate?: string) { - this.processValue(startDate); + this.processValue(startDate ?? this.value); } /**