From 16369cf4bc7382f8914b92ab9848374d9448d2d3 Mon Sep 17 00:00:00 2001 From: yigitfindikli Date: Mon, 6 Dec 2021 18:43:40 +0300 Subject: [PATCH] Fixed #10922 - Calendar manual input doesn't work --- src/app/components/calendar/calendar.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/app/components/calendar/calendar.ts b/src/app/components/calendar/calendar.ts index fe48665eb0b..1c30cd8ecd0 100755 --- a/src/app/components/calendar/calendar.ts +++ b/src/app/components/calendar/calendar.ts @@ -460,6 +460,8 @@ export class Calendar implements OnInit,OnDestroy,ControlValueAccessor { _view: string = 'date'; + preventFocus: boolean; + @Input() get view(): string { return this._view; }; @@ -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; } } @@ -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; } }