telerik / kendo-angular

Issue tracker - Kendo UI for Angular
http://www.telerik.com/kendo-angular-ui/
Other
466 stars 215 forks source link

[Editor] Programmatically focusing the Editor in ngAfterViewInit throws an error #4231

Open zstoyanova9 opened 6 months ago

zstoyanova9 commented 6 months ago

Describe the bug Focusing the Editor in ngAfterViewInit by using the built-in focus() method throws an error in the console. It seems like this happens since the view is not available at this moment and needs some time to render. This also prevents the Editor from being focused.

To Reproduce

  1. Create an Editor component.
  2. Use the focus() method to focus the component in the ngAfterViewInit() method.
  3. Open the browser's console and observe the error.

StackBlitz example: https://stackblitz.com/edit/angular-tipbkl-xdtnud

Expected behavior An error should not be thrown.

Screenshots image

Workaround https://stackblitz.com/edit/angular-tipbkl-xaeecc

aerugoone commented 6 months ago

I have found that using the Editor component blur() method causes the exact same error.