Skip to content

Commit

Permalink
fix(calendar): focusCentralDate function should only use buttons insi…
Browse files Browse the repository at this point in the history
…de the dates table (#2072)
  • Loading branch information
gerjanvangeest authored Sep 11, 2023
1 parent b89d889 commit 9b9485d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/khaki-wasps-worry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lion/ui': patch
---

[calendar] focusCentralDate function should only use buttons inside the dates table
5 changes: 4 additions & 1 deletion packages/ui/components/calendar/src/LionCalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9b9485d

Please sign in to comment.