Skip to content

Commit

Permalink
Fixed #10922 - Calendar manual input doesn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
yigitfindikli committed Dec 6, 2021
1 parent ad49bf0 commit 16369cf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/app/components/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,8 @@ export class Calendar implements OnInit,OnDestroy,ControlValueAccessor {

_view: string = 'date';

preventFocus: boolean;

@Input() get view(): string {
return this._view;
};
Expand Down Expand Up @@ -1844,11 +1846,13 @@ export class Calendar implements OnInit,OnDestroy,ControlValueAccessor {
if (cell) {
cell.tabIndex = '0';

if (!this.navigationState || !this.navigationState.button) {
if (!this.preventFocus && (!this.navigationState || !this.navigationState.button)) {
setTimeout(() => {
cell.focus();
}, 1);
}

this.preventFocus = false;
}
}

Expand Down Expand Up @@ -2280,6 +2284,11 @@ export class Calendar implements OnInit,OnDestroy,ControlValueAccessor {
showOverlay() {
if (!this.overlayVisible) {
this.updateUI();

if (!this.touchUI) {
this.preventFocus = true;
}

this.overlayVisible = true;
}
}
Expand Down

0 comments on commit 16369cf

Please sign in to comment.