Open Razinsky opened 7 years ago
Interesting scenario!
I can't see an easy way to achieve this with the current API. Here is an attempt to achieve something that looks similar.
If you have any ideas how to extend the API to support this scenario, please share.
We have the same options to open autosuggest on outside event (clicking on arrow)
if (!this.autosuggest.state.isCollapsed) {
console.log('Before close onClick')
this.autosuggest.setState({ isCollapsed: true })
} else {
console.log('Before open onClick')
this.autosuggest.setState({ isCollapsed: false })
}
But this scenario does not work. It will open suggestions only when click event is originated from autosuggest's input field.
I think we really need this.autosuggest.open()
and this.autosuggest.close()
methods.
It's also might be a trigger mode when suggestion list should be opened on click(touch) event and closed on next click, working like a trigger. No matter whether empty input or not.
In my app, I use
renderSuggestionsContainer
to add some custom action buttons right after the suggestions. I need those actions to be available from the moment the user focus on the input, even before typing anything. Is there a proper way of achieving this?Thanks.