-
Notifications
You must be signed in to change notification settings - Fork 90
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
How to clear the selected value Programmatically ? #94
Comments
+1 Can't set the input value to an empty string via JavaScript, weird 😅 |
+1, Any news ? |
+1 I will really appreciate if there is a workaround or anyone explain how the text input displayed within the search bar is accessed. |
i need help, any news? |
Solution: |
Can you please provide more details on your implementation? I too can choose .clear-icon through querySelector but clicking it inside of handleOnSelect seemingly does nothing. Already wasted 2 hours on this so greatly appreciate your response |
@Junder729 what if .clear-icon is disabled ? is other words isn't displayed ! Did you solution work for this case too ? |
Good that the mantainers didn't even bother to help :/ |
Like this: const [inputSearchString, setInputSearchString] = useState('' as string);
//...
<ReactSearchAutocomplete
onSelect={() => {
//...select logic here
setInputSearchString('')
}
onSearch={(str) => {
setInputSearchString(str);
}}
inputSearchString={inputSearchString}/> |
How to clear the value of the input box with the help of code ? Isn't there any function exposed ? There is nothing in the docs as well.
The text was updated successfully, but these errors were encountered: