react-native-material-design-searchbar
react-native-material-design-searchbar copied to clipboard
Close button not clearing search value
On React Native 0.55 (and possibly earlier versions), clicking the close button no longer clears the text.
https://github.com/ananddayalan/react-native-material-design-searchbar/blob/master/SearchBar.js#L85
Using setNativeProps isn't good practice because there are platform differences between Android and iOS that could break it. And now we know that updated versions of React Native have broken it altogether.
The better way is to store the search value in state and pass that as a prop to the TextInput. I'll submit a PR.
PR #31 fixes this. My previous commits have not been merged and the latest commit stacks onto those.
Confirming this behaviour
Has this issue been resolved? I am experiencing the same issue.
Still waiting on @ananddayalan to merge my PR.
In the meantime, you can use my fork by directly pointing the dependency to the repo:
"dependencies": {
"react-native-material-design-searchbar": "git+https://github.com/peacechen/react-native-material-design-searchbar.git",
...
}