mattermost-mobile/patches/react-native-elements+2.2.0.patch
Mattermost Build dc87e20bcb
Update react-native-elements (#4658) (#4683)
(cherry picked from commit 27849beed4)

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2020-08-15 10:58:07 -04:00

51 lines
1.6 KiB
Diff

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 e8394b6..0eaf9dd 100644
--- a/node_modules/react-native-elements/src/searchbar/SearchBar-android.js
+++ b/node_modules/react-native-elements/src/searchbar/SearchBar-android.js
@@ -31,6 +31,12 @@ const defaultClearIcon = {
};
class SearchBar extends Component {
+ componentDidUpdate(prevProps) {
+ if (this.props.value !== prevProps.value) {
+ this.setState({isEmpty: this.props.value === ''});
+ }
+ }
+
focus = () => {
this.input.focus();
};
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 b656616..6ecbad2 100644
--- a/node_modules/react-native-elements/src/searchbar/SearchBar-ios.js
+++ b/node_modules/react-native-elements/src/searchbar/SearchBar-ios.js
@@ -40,6 +40,12 @@ class SearchBar extends Component {
};
}
+ componentDidUpdate(prevProps) {
+ if (this.props.value !== prevProps.value) {
+ this.setState({isEmpty: this.props.value === ''});
+ }
+ }
+
focus = () => {
this.input.focus();
};
@@ -265,7 +271,6 @@ const styles = StyleSheet.create({
paddingBottom: 13,
paddingTop: 13,
flexDirection: 'row',
- overflow: 'hidden',
alignItems: 'center',
},
input: {
@@ -276,7 +281,7 @@ const styles = StyleSheet.create({
borderBottomWidth: 0,
backgroundColor: '#dcdce1',
borderRadius: 9,
- minHeight: 36,
+ minHeight: 30,
marginLeft: 8,
marginRight: 8,
},