Skip to content

Commit 3edec0a

Browse files
committed
fix: fix tests, remove focus locked in calendar
1 parent e74a9ca commit 3edec0a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

packages/main/cypress/specs/Calendar.cy.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ describe("Calendar general interaction", () => {
136136
cy.ui5CalendarGetDay("#calendar1", "974851200")
137137
.realClick();
138138

139+
cy.focused().realPress("Tab");
140+
cy.focused().realPress("Tab");
139141
cy.focused().realPress("Tab");
140142
cy.focused().realPress("Tab");
141143
cy.focused().realPress("Space");

packages/main/src/Calendar.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,6 @@ class Calendar extends CalendarPart {
339339
this._currentPickerDOM.focus();
340340
}
341341

342-
async _onfocusin() {
343-
await this._focusCurrentPicker();
344-
}
345-
346342
/**
347343
* @private
348344
*/
@@ -749,6 +745,7 @@ class Calendar extends CalendarPart {
749745
if (isF4(e) && this._currentPicker !== "month") {
750746
this._currentPicker = "month";
751747
this.fireDecoratorEvent("show-month-view");
748+
this._focusCurrentPicker();
752749
}
753750

754751
if (!isF4Shift(e)) {
@@ -758,9 +755,11 @@ class Calendar extends CalendarPart {
758755
if (this._currentPicker !== "year") {
759756
this._currentPicker = "year";
760757
this.fireDecoratorEvent("show-year-view");
758+
this._focusCurrentPicker();
761759
} else {
762760
this._currentPicker = "yearrange";
763761
this.fireDecoratorEvent("show-year-range-view");
762+
this._focusCurrentPicker();
764763
}
765764
}
766765

packages/main/src/CalendarTemplate.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ export default function CalendarTemplate(this: Calendar) {
1212
<div
1313
class="ui5-cal-root"
1414
onKeyDown={this._onkeydown}
15-
onFocusIn={this._onfocusin}
1615
>
1716
<div id={`${this._id}-content`} class="ui5-cal-content">
1817
<DayPicker

0 commit comments

Comments
 (0)