This is a migrated thread and some comments may be shown as answers.

Override Keyboard accesibility

1 Answer 106 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Prashant
Top achievements
Rank 1
Prashant asked on 08 Oct 2020, 08:15 AM

Hi, There

I want to override keyboard accessibility feature in date picker. i am using it in angular 9. 

can i do this?

if yes then how?

1 Answer, 1 is accepted

Sort by
0
Martin Bechev
Telerik team
answered on 12 Oct 2020, 06:11 AM

Hello Prashant,

I am afraid that the DatePicker component does not support changing the built-in keyboard navigation. However, the navigation can be customized by using a custom JavaScript code.

The developer needs to use generic events and methods, such as - keydown, addEventListener, to capture user interactions. Note that in this case, the default behavior of the overwritten key needs to be prevented (e.g. preventDefault, stopPropagation). 

Please check the following example where the DatePicker popup is toggled by pressing the Enter key as an example:

https://stackblitz.com/edit/angular-c3a76w?file=app/app.component.ts

Keep in mind that such demos are not an officially supported and tested solution and might not work with future releases of the package. So use it at your own discretion.

Regards,
Martin
Progress Telerik

Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive, special prizes, and more, for FREE?! Register now for DevReach 2.0(20).

Tags
DatePicker
Asked by
Prashant
Top achievements
Rank 1
Answers by
Martin Bechev
Telerik team
Share this question
or