Skip to content

Commit 009acc0

Browse files
committed
#CX-20521: fix next page calendar disabled exception
1 parent b219f60 commit 009acc0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

web-components/src/components/datepicker/datepicker-calendar/DatePickerCalendar.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe("DatePickerCalendar Component", () => {
2020

2121
test("should update view anchor date when changing months", async () => {
2222
const el: DatePickerCalendar.ELEMENT = await fixture(html` <md-datepicker-calendar></md-datepicker-calendar> `);
23-
const event = new MouseEvent("click");
23+
const event = new MouseEvent("button-click");
2424
const setDateFunc = jest.spyOn(el, "setDate");
2525

2626
const nextMonthButton = el.shadowRoot?.querySelector("[aria-label^='next month']");

web-components/src/components/datepicker/datepicker-calendar/DatePickerCalendar.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export namespace DatePickerCalendar {
105105
aria-label=${`previous month`}
106106
title=${`previous month`}
107107
?disabled=${allPrevDaysDisabled}
108-
@click=${!allPrevDaysDisabled && this.decreaseMonth}
108+
@button-click=${!allPrevDaysDisabled && this.decreaseMonth}
109109
tabindex="-1"
110110
>
111111
<md-icon name="arrow-left-bold" size="16" iconSet="momentumDesign"></md-icon>
@@ -124,7 +124,7 @@ export namespace DatePickerCalendar {
124124
aria-label=${`next month`}
125125
title=${`next month`}
126126
?disabled=${allNextDaysDisabled}
127-
@click=${!allNextDaysDisabled && this.increaseMonth}
127+
@button-click=${this.increaseMonth}
128128
tabindex="-1"
129129
><md-icon name="arrow-right-bold" size="16" iconSet="momentumDesign"></md-icon>
130130
</md-button>

0 commit comments

Comments
 (0)