-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is there any options to Disallow some special characters in input when type? #344
Comments
This seems like a duplicate of #230, but please reopen if you feel I'm misunderstanding something. |
Seems also related to #33 |
Hi @ericgio , When i type the text, it will upate the value in state.query in Typeahead Component and i will update this value by setState({myVar:value}) in my component through InputChange. I will check these special characters (@$%^) found in myVar, if true, then ill remove the special characters from myVar and i need to update this value in Typeahead state.query. I am validating the value only when type and not in selecting the dropdown. I can update the modified value in myVar but i can't update in query. Any solution,please. |
You can modify the query when you get it from your |
Hi @ericgio , onKeyDown={(e) => {
var a = e.key;
if (SPECIAL_CHARACTERS_VALIDATOR.indexOf(a) > -1) {
e.preventDefault();
}
}} and yes disallowing key typed... Cheers!!! |
@gopinath-sixt: Just so I understand, did the above code solve your problem, or is it just an example of what you're trying to achieve? |
@ericgio yeah working fine |
Version
^3.1.2
Steps to reproduce
user typing the text|numeric|some special chararter in asynctypeahead input component and getting dropdown value perfectly. Validating the entered text|numeric|some special chararter through InputChange.
Expected Behavior
Some options for special character shouldn't be allow to enter in input.
Actual Behavior
There is no restriction.
The text was updated successfully, but these errors were encountered: