Textbox Control - Special Characters Input Problem

Hi, 
Here are some problems about Textbox Contorl for special characters input.
In terms of that I have coded some restrictions for inputting some special characters, e.g. /, +, etc., it  works well if I enter the text by using the embeded Microsoft English input-method; however, in case of it is in Microsoft PinYin (拼音) mode for input, then it still allow to input these special characters.

For example, enter the letter “a”, then it pops the Chinese character list for selection, and then enter the symbol "+" following it and press the [ENTER] immediately, it comes the result "a+" , which shouldn't be allowed according to the control.

https://stackblitz.com/edit/angular-scatwj
 onKeydown(e: any) {
    if (e.key === "." || e.key === "-" || e.key === "+") {
      e.preventDefault();
      return true;
    }
  }



1 Reply 1 reply marked as answer

BC Berly Christopher Syncfusion Team January 26, 2021 11:53 AM UTC

Hi Techlandandyzhang, 
  
Greetings from Syncfusion support. 
  
We have checked the reported issue with shared sample code. In the sample, you have written code for restricting the special characters. If you are typing restricted characters in the English keyboard, Syncfusion TextBox prevents the value typing correctly.  
  
When you are enabled the Microsoft PinYin mode for input, then the restricted characters are allowed both in the Syncfusion TextBox component and HTML 5 Textbox component. Since, the Chinese characters are differed from the English characters. So, we suggest you to make the condition based on the Chinese keyboard in the application itself to get rid of the reported issue. 
  
Regards, 
Berly B.C 


Marked as answer
Loader.
Up arrow icon