Skip to content

Commit 666728e

Browse files
fix(datetime): validate if focus is on day
1 parent 3d9ac56 commit 666728e

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

core/src/components/datetime/datetime.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,9 +1035,8 @@ export class Datetime implements ComponentInterface {
10351035
}
10361036

10371037
const activeEl = this.el.shadowRoot!.activeElement as HTMLElement | null;
1038-
if (activeEl) {
1039-
activeEl.blur();
1040-
calendarBodyRef.focus();
1038+
if (activeEl && activeEl.classList.contains('calendar-day')) {
1039+
(activeEl.closest('.calendar-body') as HTMLElement | null)?.focus();
10411040
}
10421041
});
10431042
};

0 commit comments

Comments
 (0)