appbaseio / reactivesearch

Search UI components for React and Vue
https://opensource.appbase.io/reactivesearch
Apache License 2.0
4.89k stars 466 forks source link

web: Suggestions do not display when using search components as controlled components #379

Closed divyanshu013 closed 6 years ago

divyanshu013 commented 6 years ago

Issue Type:

Bug

Platform:

Web

Description:

When using the search components as a controlled component (with defaultSelected and onValueChange) the suggestions do not display unless I blur and refocus the input.

This is due to how defaultSelected update happens in the component. Whenever the value of the component is changed via defaultSelected, isOpen is set to false. This works for uncontrolled input but not in a controlled environment.

Reactivesearch version: x.y.z

2.6.5

divyanshu013 commented 6 years ago

Since the value updates are done to the store with defaultSelected, I'm not sure if showing suggestions make sense here.