telerik / kendo-angular

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

[Scheduler] Using arrow keys for custom toolbar tools throws an error #4379

Closed mbechev closed 2 days ago

mbechev commented 1 month ago

Describe the bug The built-in toolbar tools of the Scheduler are accessible with arrow keys by default: https://www.telerik.com/kendo-angular-ui/components/scheduler/keyboard-navigation/

But using the kendoSchedulerToolbarTemplate to create custom tools, throws an error when arrow keys are used for focused elements:

TypeError: Cannot read properties of undefined (reading 'containerType') at Object.action (progress-kendo-angular-scheduler.mjs:17365:51) at ShortcutsDirective.onKeydown (progress-kendo-angular-scheduler.mjs:17417:19) at Object.eval [as next] (progress-kendo-angular-scheduler.mjs:17411:66) at Object.eval [as next] (Subscriber.ts:194:14) at Subscriber.next (Subscriber.ts:119:22) at Subscriber.next (Subscriber.ts:75:12) at eval (Subject.ts:63:20) at Object.errorContext (errorContext.ts:29:5) at Subject.next (Subject.ts:58:5) at EventEmitter.emit (event_emitter.ts:142:7)

To Reproduce

  1. Focus on any button in the toolbar (the issue is reproduced with other components as well).
  2. Press any arrow key to reproduce the error.

https://stackblitz.com/edit/angular-sjv15f-didock

Expected behavior No errors should be thrown when using arrow keys in this case.

tswetti commented 1 month ago

The following workarounds can be used until the issue is resolved: Stop the propagation of the keydown event in the template - https://stackblitz.com/edit/angular-sjv15f-rackpm?file=src%2Fapp%2Fapp.component.ts Prevent the navigation of the Scheduler - https://stackblitz.com/edit/angular-sjv15f-fakfon?file=src%2Fapp%2Fapp.component.ts In both cases, the developer should implement custom navigation - for the toolbar and for the whole Scheduler, respectively.

Raisolution commented 2 days ago

Fixed in v.16.9.1-develop.3