Hello,
I have a view in my app that makes use of the component.
I want to pass it a default value, but it triggers the suggestions.
How can I prevent this from happening and control the list of suggestions to only appear after the user has clicked on it?
Thank you.
The same problem occurs in my case.
I use this package from long time and that problem started few weeks ago.
Here also same problem occur in RN0.44 only in Android. In previous version there is no such problem occur, maybe it's a new version problem!! Can anyone help to resolve the solution.
Check the source code. This happens because of
componentDidMount() {
// This will load the default value's search results after the view has
// been rendered
this._isMounted = true;
this._onChangeText(this.state.text);
}
As soon as the component mounts they are calling _onChangeText which changes the listViewDisplayed to true. Even if we specified it to be false earlier. This call is unnecessary in componentDidMount because in the constructor we are already setting the default values.
I commented _onChangeText call and everything seems to be alright.
@FaridSafi
Most helpful comment
Check the source code. This happens because of
componentDidMount() {
// This will load the default value's search results after the view has
// been rendered
this._isMounted = true;
this._onChangeText(this.state.text);
}
As soon as the component mounts they are calling _onChangeText which changes the listViewDisplayed to true. Even if we specified it to be false earlier. This call is unnecessary in componentDidMount because in the constructor we are already setting the default values.
I commented _onChangeText call and everything seems to be alright.
@FaridSafi