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

keyboard event support

3 Answers 81 Views
Switch (Mobile)
This is a migrated thread and some comments may be shown as answers.
mathieu
Top achievements
Rank 1
mathieu asked on 28 Feb 2017, 04:26 PM

Hi,
I would like to be able to check/uncheck the switch with the keyboard
but nothing bind to the switch. i tried : 

scope.toggleSwitch.bind("keyup", toggleKeyUp);
scope.toggleSwitch.bind("focus", toggleFocus);
scope.toggleSwitch.bind("click", toggleclick);

any idea wuld be appreciate thanks

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 02 Mar 2017, 02:01 PM
Hello Мathieu,

This occurs because the rendered switch is actually a span element which does not have key events.

The click event can be attached, but the widget is already toggling values on click:

http://dojo.telerik.com/obARA

Let me know if you need information on this matter.

Regards,
Stefan
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data (charts) and form elements.
0
Barry P
Top achievements
Rank 1
answered on 12 Aug 2018, 02:33 PM
So does this mean there's no way to have the user alter the state of the switch with the keyboard?
0
Stefan
Telerik team
answered on 13 Aug 2018, 07:30 AM
Hello, Barry,

This could be done by for example placing the switch in a container and attaching the key events to the container.

Then when the events are fired to use the desired method of the Switch to change its state:

https://docs.telerik.com/kendo-ui/api/javascript/mobile/ui/switch#methods

Regards,
Stefan
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Switch (Mobile)
Asked by
mathieu
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Barry P
Top achievements
Rank 1
Share this question
or