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

Keydown events in MaskedTextBox?

3 Answers 477 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 01 May 2019, 12:59 PM
I dont see any way to detect key events on a MaskedTextBox besides resorting to jQuery. Am I overlooking something? If the syntheticEvent was against an InputElement instead of an HTMLElement I think I might be able to but that's not the way it is defined right now. I am specifically looking to capture keys such as escape/enter.

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 01 May 2019, 01:35 PM
Hello, Ryan,

I can suggest using the component ref and attaching the desired event listener directly to the input element.

I made an example demonstrating this:

https://stackblitz.com/edit/react-gz7gfv?file=app/main.jsx

I hope this is helpful.

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Ryan
Top achievements
Rank 1
answered on 01 May 2019, 01:46 PM
Do you anticipate an onKeyDown handler propr being added in the future? Or do you think it is always going to be handled by ref?
0
Stefan
Telerik team
answered on 02 May 2019, 04:29 AM
Hello, Ryan,

The components features highly depend on the features request submitted by the community.

Still, please have in mind that we are trying to keep the components as simple and extensible as possible. Our idea is that if some functionality can be easily achieved with a 1 or 2 lines of code it could stay outside of the component.  Nevertheless we listen to the community and if we see that this is a requested feature that will make the use of the components more fluent, we will add it in a future release:

https://feedback.telerik.com/kendo-react-ui/

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Ryan
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Ryan
Top achievements
Rank 1
Share this question
or