fix(calendar): focusCentralDate function should only use buttons inside the dates table (#2072)

This commit is contained in:
gerjanvangeest 2023-09-11 14:24:39 +02:00 committed by GitHub
parent b89d889fd5
commit 9b9485dbaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'@lion/ui': patch
---
[calendar] focusCentralDate function should only use buttons inside the dates table

View file

@ -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;
}