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

MaskedTextBox cannot be cleared

1 Answer 354 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
Iron
Iron
Veteran
David asked on 11 Mar 2021, 07:52 AM

Hi,

It doesn't seem to be possible to clear the value of a KendoReact MaskedTextBox. This can be seen here: https://stackblitz.com/edit/react-xnkrec?file=app/main.jsx

Once you have set a value, it isn't possible to clear it. Deleting everything in the input sets the value to the full mask. This is different behaviour to the jQuery MaskedTextBox which clears the value if the raw value is empty.

Is this intended behaviour?

Kind regards,

David

1 Answer, 1 is accepted

Sort by
0
Krissy
Telerik team
answered on 11 Mar 2021, 12:06 PM

Hello David, 

Yes, this is the intended behavior of the KendoReact MaskedTextbox. The mask can be cleared when the input is empty by controlling the state of the value prop. I've created an example to showcase how this can be achieved:

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

Hope this is helpful.

Regards,
Krissy
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
David
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Krissy
Telerik team
Share this question
or