react-autosuggest
react-autosuggest copied to clipboard
Need help on "having the suggestion lists open if user click done in iOS virtual keyboard"
*Example Basic example.
- Provide the steps to reproduce the issue, e.g.:
- Focus on the input field
- Type
c
, and wait for suggestions to appear - Click
done
after typing dismiss suggestions

Observed behaviour: Suggestions stay open
When done
button is clicked in virtual keyboard, suggestions are dismissed.
Expected behaviour: Suggestions should be closed
When done
button is clicked in virtual keyboard, suggestions are will stay open
- Please describe your use case from user journey point of view, e.g.:
I want to keep the suggestions list open if user click
done
button in iOS virtual keyboard.
+1
same issue in 2019
same issue in 2020
+1
Is it really an expected behaviour? What if user clicked done
to remove the keyboard from the screen and then tap a suggestion?
I've been looking for a fix as well. I came up with this work around. Basically if the input is blurred it will never clear out the suggestions unless the input box is empty. Which is also kind of annoying because you can't close the suggestions unless you clear out the input box. However you could add an X button or something to clear it. I also render the input to select all of the text on focus to easily clear it out with a backspace.
onSuggestionsClearRequested = () => { if(this.state.value.trim() === '') { this.setState({ suggestions: [] }); } };
const inputComponent = inputProps => ( <div> <input {...inputProps} style={{cursor:"pointer"}} onClick={(event) => event.target.select()}/> </div> );