react-native-material-design-searchbar icon indicating copy to clipboard operation
react-native-material-design-searchbar copied to clipboard

Close button not clearing search value

Open peacechen opened this issue 7 years ago • 4 comments

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.

peacechen avatar May 25 '18 21:05 peacechen

PR #31 fixes this. My previous commits have not been merged and the latest commit stacks onto those.

peacechen avatar May 27 '18 02:05 peacechen

Confirming this behaviour

iRoachie avatar Jun 25 '18 03:06 iRoachie

Has this issue been resolved? I am experiencing the same issue.

chrisfenos avatar Nov 05 '18 18:11 chrisfenos

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",
    ...
}

peacechen avatar Nov 05 '18 20:11 peacechen