From 6dea1c699afd2fc7aa5937360ddd4f615842961f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Louren=C3=A7o?= Date: Thu, 19 Mar 2026 12:05:20 +0000 Subject: [PATCH 1/3] fix(datetime): days keep in focus after changing the month --- core/src/components/datetime/datetime.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/components/datetime/datetime.tsx b/core/src/components/datetime/datetime.tsx index a7a3c2d1d2c..e63a0743f19 100644 --- a/core/src/components/datetime/datetime.tsx +++ b/core/src/components/datetime/datetime.tsx @@ -1033,6 +1033,12 @@ export class Datetime implements ComponentInterface { if (this.resolveForceDateScrolling) { this.resolveForceDateScrolling(); } + + const activeEl = document.activeElement as HTMLElement | null; + if (activeEl) { + activeEl.blur(); + calendarBodyRef.focus(); + } }); }; From 3d9ac565996c8aabaa45d861d8df80bd914b9a93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Louren=C3=A7o?= Date: Thu, 19 Mar 2026 14:08:53 +0000 Subject: [PATCH 2/3] update core/src/components/datetime/datetime.tsx Co-authored-by: Shane --- core/src/components/datetime/datetime.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/components/datetime/datetime.tsx b/core/src/components/datetime/datetime.tsx index e63a0743f19..c7b446baa0d 100644 --- a/core/src/components/datetime/datetime.tsx +++ b/core/src/components/datetime/datetime.tsx @@ -1034,7 +1034,7 @@ export class Datetime implements ComponentInterface { this.resolveForceDateScrolling(); } - const activeEl = document.activeElement as HTMLElement | null; + const activeEl = this.el.shadowRoot!.activeElement as HTMLElement | null; if (activeEl) { activeEl.blur(); calendarBodyRef.focus(); From 666728e9ad97852e171f018a498278b62df288c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Louren=C3=A7o?= Date: Thu, 19 Mar 2026 14:43:15 +0000 Subject: [PATCH 3/3] fix(datetime): validate if focus is on day --- core/src/components/datetime/datetime.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/components/datetime/datetime.tsx b/core/src/components/datetime/datetime.tsx index c7b446baa0d..a81e84ec8b9 100644 --- a/core/src/components/datetime/datetime.tsx +++ b/core/src/components/datetime/datetime.tsx @@ -1035,9 +1035,8 @@ export class Datetime implements ComponentInterface { } const activeEl = this.el.shadowRoot!.activeElement as HTMLElement | null; - if (activeEl) { - activeEl.blur(); - calendarBodyRef.focus(); + if (activeEl && activeEl.classList.contains('calendar-day')) { + (activeEl.closest('.calendar-body') as HTMLElement | null)?.focus(); } }); };