File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,10 @@ class Autocomplete extends Component {
143143
144144 handleBlur ( ) {
145145 clearTimeout ( this . timer ) ;
146- this . setState ( { loading : false , items : [ ] } ) ;
146+ this . setState ( { loading : false } ) ;
147+ if ( this . dropdown ) {
148+ this . dropdown . close ( ) ;
149+ }
147150 }
148151
149152 render ( ) {
Original file line number Diff line number Diff line change @@ -159,6 +159,20 @@ export default class Dropdown extends PureComponent {
159159 } ) ;
160160 }
161161
162+ close ( ) {
163+ const { onBlur, onDropdownClose} = this . props ;
164+
165+ if ( typeof onBlur === "function" ) {
166+ onBlur ( ) ;
167+ }
168+ if ( typeof onDropdownClose === "function" ) {
169+ onDropdownClose ( ) ;
170+ }
171+ if ( this . mounted ) {
172+ this . setState ( { modal : false } ) ;
173+ }
174+ }
175+
162176 onClose ( val ) {
163177 const { onBlur, onDropdownClose} = this . props ;
164178 const { value} = this . state ;
Original file line number Diff line number Diff line change 11import PropTypes from "prop-types" ;
22import React , { PureComponent } from "react" ;
3- import { Keyboard } from 'react-native' ;
3+ import { Keyboard } from 'react-native' ;
44import { Button } from "react-native-material-buttons" ;
55import styles from "./DropdownItem.styles" ;
66import { theme } from "../../constants/Theme" ;
You can’t perform that action at this time.
0 commit comments