diff --git a/node_modules/react-native-elements/src/searchbar/SearchBar-android.js b/node_modules/react-native-elements/src/searchbar/SearchBar-android.js index f44866a..76406c2 100644 --- a/node_modules/react-native-elements/src/searchbar/SearchBar-android.js +++ b/node_modules/react-native-elements/src/searchbar/SearchBar-android.js @@ -78,6 +78,12 @@ class SearchBar extends Component { }; } + componentDidUpdate(prevProps) { + if (this.props.value !== prevProps.value) { + this.setState({isEmpty: this.props.value === ''}); + } + } + render() { const { clearIcon, diff --git a/node_modules/react-native-elements/src/searchbar/SearchBar-ios.js b/node_modules/react-native-elements/src/searchbar/SearchBar-ios.js index 32a28d5..d43e9bf 100644 --- a/node_modules/react-native-elements/src/searchbar/SearchBar-ios.js +++ b/node_modules/react-native-elements/src/searchbar/SearchBar-ios.js @@ -41,6 +41,12 @@ class SearchBar extends Component { }; } + componentDidUpdate(prevProps) { + if (this.props.value !== prevProps.value) { + this.setState({isEmpty: this.props.value === ''}); + } + } + focus = () => { this.input.focus(); }; @@ -260,7 +266,6 @@ const styles = StyleSheet.create({ paddingBottom: 13, paddingTop: 13, flexDirection: 'row', - overflow: 'hidden', alignItems: 'center', }, input: { @@ -271,7 +276,7 @@ const styles = StyleSheet.create({ borderBottomWidth: 0, backgroundColor: '#dcdce1', borderRadius: 9, - minHeight: 36, + minHeight: 30, marginLeft: 8, marginRight: 8, },