I wish to remove specific characters inside Spark TextInput while user typing on it, without this causing any distrbance like licking with mouse after the last character or alike.
- Any suggestions is appreciated.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can create your own custom TextInput component and override the
keyDownHandler()or you can add a event listener on theTextInput, like this:and then on the event handler:
This way the character will never be added to the
TextInput, which means the text property and the cursor position will not change.Note: Use the
event.charCodeandevent.keyCodeto make the necessary validations.