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 eeaeb81..93f58de 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 41ef6be..dbf727b 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(); }; @@ -259,7 +265,6 @@ const styles = StyleSheet.create({ paddingBottom: 13, paddingTop: 13, flexDirection: 'row', - overflow: 'hidden', alignItems: 'center', }, input: { @@ -270,7 +275,7 @@ const styles = StyleSheet.create({ borderBottomWidth: 0, backgroundColor: '#dcdce1', borderRadius: 9, - minHeight: 36, + minHeight: 30, marginLeft: 8, marginRight: 8, },