fix(lion-calendar): Make calendar buttons selectable on firefox through datepicker (#2080)
This commit is contained in:
parent
b1320a9a9c
commit
63a8e725db
2 changed files with 9 additions and 2 deletions
5
.changeset/yellow-timers-poke.md
Normal file
5
.changeset/yellow-timers-poke.md
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@lion/ui': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
lion-calendar: when determining if user interacted with a day button, use event.composedPath()[0] instead of event.target to fix Firefox 111+ issue
|
||||||
|
|
@ -799,7 +799,7 @@ export class LionCalendar extends LocalizeMixin(LitElement) {
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
__clickDateDelegation(ev) {
|
__clickDateDelegation(ev) {
|
||||||
const el = /** @type {HTMLElement & { date: Date }} */ (ev.target);
|
const el = /** @type {HTMLElement & { date: Date }} */ (ev.composedPath()[0]);
|
||||||
if (isDayButton(el) && !isDisabledDayButton(el)) {
|
if (isDayButton(el) && !isDisabledDayButton(el)) {
|
||||||
this.__dateSelectedByUser(el.date);
|
this.__dateSelectedByUser(el.date);
|
||||||
}
|
}
|
||||||
|
|
@ -866,7 +866,9 @@ export class LionCalendar extends LocalizeMixin(LitElement) {
|
||||||
switch (ev.key) {
|
switch (ev.key) {
|
||||||
case ' ':
|
case ' ':
|
||||||
case 'Enter':
|
case 'Enter':
|
||||||
this.__dayButtonSelection(/** @type {HTMLElement & { date: Date }} */ (ev.target));
|
this.__dayButtonSelection(
|
||||||
|
/** @type {HTMLElement & { date: Date }} */ (ev.composedPath()[0]),
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
case 'ArrowUp':
|
case 'ArrowUp':
|
||||||
this.__modifyDate(-7, { dateType: '__focusedDate', type: 'Date' });
|
this.__modifyDate(-7, { dateType: '__focusedDate', type: 'Date' });
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue