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 1bfd2b4..436e870 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'; @@ -68,24 +68,17 @@ class SearchBar extends Component { }; this.onBlur = (event) => { this.props.onBlur(event); - this.setState({ hasFocus: false }); + this.setState({ hasFocus: false, isEmpty: this.props.value === '' }); }; this.onChangeText = (text) => { 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 8fe90be..3daf517 100644 --- a/node_modules/react-native-elements/dist/searchbar/SearchBar-ios.js +++ b/node_modules/react-native-elements/dist/searchbar/SearchBar-ios.js @@ -85,6 +85,11 @@ class SearchBar extends Component { cancelButtonWidth: null, }; } + componentDidUpdate(prevProps) { + if (this.props.value !== prevProps.value) { + this.setState({isEmpty: this.props.value === ''}); + } + } render() { var _a, _b, _c, _d, _e, _f, _g; const _h = this.props, { theme, cancelButtonProps, cancelButtonTitle, clearIcon, containerStyle, leftIconContainerStyle, rightIconContainerStyle, inputContainerStyle, inputStyle, placeholderTextColor, showLoading, loadingProps, searchIcon, showCancel } = _h, attributes = __rest(_h, ["theme", "cancelButtonProps", "cancelButtonTitle", "clearIcon", "containerStyle", "leftIconContainerStyle", "rightIconContainerStyle", "inputContainerStyle", "inputStyle", "placeholderTextColor", "showLoading", "loadingProps", "searchIcon", "showCancel"]);