MaskedTextBox mask doesn't work correctly with promptChar: "" or " "

2 Answers 251 Views
MaskedTextBox
Miroslav
Top achievements
Rank 1
Miroslav asked on 10 Nov 2021, 10:06 AM | edited on 10 Nov 2021, 12:49 PM

Hello,

I tried to hide the mask prompt characters. But I got strange results.

If I use empty string as a promptChar

input.kendoMaskedTextBox({ mask: "&", promptChar: "" });

then the mask doesn't work at all.

When I use a space as a promptChar

input.kendoMaskedTextBox({ mask: "&", promptChar: " " });

then the mask enforces the length but not contents - I can enter a space even when I shouldn't be able.

When I use an underscore as a promptChar or use default

input.kendoMaskedTextBox({ mask: "&", promptChar: "_" });

input.kendoMaskedTextBox({ mask: "&" });

then everything works as it should, I can enter only one character but not a space.

 

Is this a feature or a bug? I'm using Kendo UI v2021.1.119.

2 Answers, 1 is accepted

Sort by
0
Accepted
Milena
Telerik team
answered on 16 Nov 2021, 01:43 PM

Hello Miroslav,

 

I would suggest you to use  '\u2000' for promptChar, which is similar to space character, but it will not allow user to enter a space in MaskedTextBox. Please test the updated example and let me know if it meets your requirements.

 

Regards,
Milena
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Miroslav
Top achievements
Rank 1
commented on 16 Nov 2021, 01:54 PM | edited

Milena, thank you for the suggestion to use the "en quad" unicode character. The mask is hidden but still working correctly as I intended it. Perfect.
Milena
Telerik team
commented on 17 Nov 2021, 08:58 AM

Hello Miroslav,

I am glad to know that the provided workaround works on your end. Here, you can follow the status of the bug report.

Patrick | Technical Support Engineer, Senior
Telerik team
commented on 17 Nov 2021, 02:25 PM

Hi Miroslav,

As a token of gratitude, I have updated your Telerik points for finding the bug, taking the time let us know how to reproduce the issue, and your patience. 

We sincerely appreciate it!  

Miroslav
Top achievements
Rank 1
commented on 18 Nov 2021, 07:37 AM

Thank you.
0
Patrick | Technical Support Engineer, Senior
Telerik team
answered on 12 Nov 2021, 03:21 PM

Hi Miroslav,

First, thank you for providing the information regarding the Kendo UI MaskedTextBox and the behavior regarding the promptChar as an empty space or no character.  I can confirm I was able to reproduce the behavior with the latest version of Kendo UI as seen in this Progress Kendo UI Dojo. 

To help further analyze the specific behavior, I will be reaching out to our development team to gain more insight.  When I receive an update, I will reply back within this thread.

Thank you for you patience and understanding.

Regards,
Patrick
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Patrick | Technical Support Engineer, Senior
Telerik team
commented on 16 Nov 2021, 12:59 PM

Just wanted to follow-up with you Miroslav, the Kendo team will still need some additional time.  However, I will update this as soon as I receive word from the development team.  

Thank you again for your patience.

Miroslav
Top achievements
Rank 1
commented on 16 Nov 2021, 01:00 PM

OK no problem 🙂
Tags
MaskedTextBox
Asked by
Miroslav
Top achievements
Rank 1
Answers by
Milena
Telerik team
Patrick | Technical Support Engineer, Senior
Telerik team
Share this question
or