New to KendoReactStart a free 30-day trial

Clear NumericTextBox value on pressing ESC key

Updated on Dec 19, 2025

Environment

Product Version5.13.1
ProductProgress® KendoReact NumericTextBox

Description

I want to add custom logic to the NumericTextBox for clearing the value when the ESC key is pressed.

Solution

Within React.useEffect, after the initialization of the component, add event listener to the input element of the NumericTextBox and set the value to "null" if the keyCode is "27".

Following is an example demonstrating this approach:

Change Theme
Theme
Loading ...
In this article
EnvironmentDescriptionSolution
Not finding the help you need?
Contact Support