diff --git a/.changeset/khaki-wasps-worry.md b/.changeset/khaki-wasps-worry.md new file mode 100644 index 0000000000..acac8d0ca3 --- /dev/null +++ b/.changeset/khaki-wasps-worry.md @@ -0,0 +1,5 @@ +--- +'@lion/ui': patch +--- + +[calendar] focusCentralDate function should only use buttons inside the dates table diff --git a/packages/ui/components/calendar/src/LionCalendar.js b/packages/ui/components/calendar/src/LionCalendar.js index 48a7bfb63c..ee70577697 100644 --- a/packages/ui/components/calendar/src/LionCalendar.js +++ b/packages/ui/components/calendar/src/LionCalendar.js @@ -250,7 +250,10 @@ export class LionCalendar extends LocalizeMixin(LitElement) { } focusCentralDate() { - const button = /** @type {HTMLElement} */ (this.shadowRoot?.querySelector('[tabindex="0"]')); + const datesTable = /** @type {HTMLElement} */ ( + this.shadowRoot?.querySelector('#js-content-wrapper') + ); + const button = /** @type {HTMLElement} */ (datesTable.querySelector('[tabindex="0"]')); button.focus(); this.__focusedDate = this.centralDate; }