We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
onSearchChange is fired when the text is change and on reset. The problem is that the function is called in 2 different ways, directly by passing the value of TextInput's onChangeText and via _onClose at https://github.com/ananddayalan/react-native-material-design-searchbar/blob/master/SearchBar.js#L77
What do you think if _onClose fires onSearchChange with just an empty string or we add a new event onInputClear / onInputReset ?
The text was updated successfully, but these errors were encountered:
I agree that this is a bit counter-intuitive.
To handle the current way of calling onSearchChange, my code looks like this:
<SearchBar onSearchChange={(query) => { if(typeof query != 'string') query = query.nativeEvent.text; this.props.onChangeSearchQuery(query); }} height={lookAndFeel.baseTextInputHeight} placeholder={'Search ...'} autoCorrect={false} padding={lookAndFeel.defaultPadding} />
Removing the if statement would be nice. 👍
Sorry, something went wrong.
Looks like this was fixed in d9987c1
Is that working as you expect?
No branches or pull requests
onSearchChange is fired when the text is change and on reset.
The problem is that the function is called in 2 different ways, directly by passing the value of TextInput's onChangeText and via _onClose at https://github.com/ananddayalan/react-native-material-design-searchbar/blob/master/SearchBar.js#L77
What do you think if _onClose fires onSearchChange with just an empty string or we add a new event onInputClear / onInputReset ?
The text was updated successfully, but these errors were encountered: