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 4261cea..183bde1 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'; @@ -65,18 +65,16 @@ 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); + componentDidUpdate(prevProps) { + if (this.props.value !== prevProps.value) { + this.setState({isEmpty: this.props.value === ''}); + } } render() { const _a = this.props, { theme, clearIcon = { name: 'clear' }, containerStyle, leftIconContainerStyle, rightIconContainerStyle, inputContainerStyle, inputStyle, searchIcon = { name: 'search' }, cancelIcon = { name: 'arrow-back' }, showLoading = false, loadingProps = {} } = _a, attributes = __rest(_a, ["theme", "clearIcon", "containerStyle", "leftIconContainerStyle", "rightIconContainerStyle", "inputContainerStyle", "inputStyle", "searchIcon", "cancelIcon", "showLoading", "loadingProps"]); 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 b0761ab..4fa5e83 100644 --- a/node_modules/react-native-elements/dist/searchbar/SearchBar-ios.js +++ b/node_modules/react-native-elements/dist/searchbar/SearchBar-ios.js @@ -82,6 +82,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; @@ -159,7 +164,6 @@ const styles = StyleSheet.create({ paddingBottom: 13, paddingTop: 13, flexDirection: 'row', - overflow: 'hidden', alignItems: 'center', }, input: { @@ -169,7 +173,7 @@ const styles = StyleSheet.create({ inputContainer: { borderBottomWidth: 0, borderRadius: 9, - minHeight: 36, + minHeight: 30, marginLeft: 8, marginRight: 8, },