My type script code to restrict only alphabets:
InputValidatorChar(event:any){
Const pattern= /^[a-zA-Z]*$/;
If(! pattern.test(event.target.value)){
event.target.value=event.target.value.replace(/[^a-zA-Z/g,"");
}}
Expected output: Should accept only alphabets (example: jekrhrjek)
Output I am getting: Accepting only characters. But if I type any integer at end of the sentence as input and click outside of cell then the last typed integer is getting populated.
How to overcome this problem?
[^a-zA-Z/g... after theA-Zmissing closing].