mattermost-mobile/patches/react-native-elements+3.4.1.patch

65 lines
3 KiB
Diff

diff --git a/node_modules/react-native-elements/dist/searchbar/SearchBar-android.js b/node_modules/react-native-elements/dist/searchbar/SearchBar-android.js
index fe25d36..a2a1a34 100644
--- a/node_modules/react-native-elements/dist/searchbar/SearchBar-android.js
+++ b/node_modules/react-native-elements/dist/searchbar/SearchBar-android.js
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
return t;
};
import React, { Component } from 'react';
-import { StyleSheet, View, ActivityIndicator, Keyboard, } from 'react-native';
+import { StyleSheet, View, ActivityIndicator, } from 'react-native';
import { renderNode } from '../helpers';
import Input from '../input/Input';
import Icon from '../icons/Icon';
@@ -74,18 +74,11 @@ class SearchBar extends Component {
this.props.onChangeText(text);
this.setState({ isEmpty: text === '' });
};
- this._keyboardDidHide = () => {
- this.cancel();
- };
const { value = '' } = props;
this.state = {
hasFocus: false,
isEmpty: value ? value === '' : true,
};
- Keyboard.addListener('keyboardDidHide', this._keyboardDidHide);
- }
- componentWillUnmount() {
- Keyboard.removeListener('keyboardDidHide', this._keyboardDidHide);
}
render() {
var _a;
diff --git a/node_modules/react-native-elements/dist/searchbar/SearchBar-ios.js b/node_modules/react-native-elements/dist/searchbar/SearchBar-ios.js
index 9581256..b10d579 100644
--- a/node_modules/react-native-elements/dist/searchbar/SearchBar-ios.js
+++ b/node_modules/react-native-elements/dist/searchbar/SearchBar-ios.js
@@ -79,6 +79,11 @@ class SearchBar extends Component {
cancelButtonWidth: null,
};
}
+ componentDidUpdate(prevProps) {
+ if (this.props.value !== prevProps.value) {
+ this.setState({isEmpty: this.props.value === ''});
+ }
+ }
render() {
const _a = this.props, { theme, cancelButtonProps, cancelButtonTitle, clearIcon, containerStyle, leftIconContainerStyle, rightIconContainerStyle, inputContainerStyle, inputStyle, placeholderTextColor, showLoading, loadingProps, searchIcon, showCancel } = _a, attributes = __rest(_a, ["theme", "cancelButtonProps", "cancelButtonTitle", "clearIcon", "containerStyle", "leftIconContainerStyle", "rightIconContainerStyle", "inputContainerStyle", "inputStyle", "placeholderTextColor", "showLoading", "loadingProps", "searchIcon", "showCancel"]);
const { hasFocus, isEmpty } = this.state;
@@ -154,7 +159,6 @@ const styles = StyleSheet.create({
paddingBottom: 13,
paddingTop: 13,
flexDirection: 'row',
- overflow: 'hidden',
alignItems: 'center',
},
input: {
@@ -164,7 +168,7 @@ const styles = StyleSheet.create({
inputContainer: {
borderBottomWidth: 0,
borderRadius: 9,
- minHeight: 36,
+ minHeight: 30,
marginLeft: 8,
marginRight: 8,
},