@@ -173,6 +173,9 @@ export default class DropdownAlert extends Component {
173173 if ( this . _closeTimeoutId != null ) {
174174 clearTimeout ( this . _closeTimeoutId ) ;
175175 }
176+ if ( this . state . isOpen ) {
177+ this . closeDirectly ( ) ;
178+ }
176179 }
177180 createPanResponder = ( ) => {
178181 this . _panResponder = PanResponder . create ( {
@@ -272,6 +275,14 @@ export default class DropdownAlert extends Component {
272275 ) ;
273276 }
274277 } ;
278+ resetStatusBarColor = ( ) => {
279+ if ( this . props . updateStatusBar ) {
280+ if ( IS_ANDROID ) {
281+ StatusBar . setBackgroundColor ( this . props . inactiveStatusBarBackgroundColor , true ) ;
282+ }
283+ StatusBar . setBarStyle ( this . props . inactiveStatusBarStyle , true ) ;
284+ }
285+ }
275286 close = action => {
276287 if ( action == undefined ) {
277288 action = 'programmatic' ;
@@ -285,15 +296,11 @@ export default class DropdownAlert extends Component {
285296 clearTimeout ( this . _closeTimeoutId ) ;
286297 }
287298 this . animate ( 0 ) ;
288- if ( this . props . updateStatusBar ) {
289- if ( IS_ANDROID ) {
290- StatusBar . setBackgroundColor ( this . props . inactiveStatusBarBackgroundColor , true ) ;
291- }
292- StatusBar . setBarStyle ( this . props . inactiveStatusBarStyle , true ) ;
293- }
299+ this . resetStatusBarColor ( ) ;
294300 setTimeout (
295301 function ( ) {
296302 if ( this . state . isOpen ) {
303+ this . resetStatusBarColor ( ) ;
297304 this . setState ( {
298305 isOpen : false ,
299306 } ) ;
@@ -321,12 +328,7 @@ export default class DropdownAlert extends Component {
321328 this . setState ( {
322329 isOpen : false ,
323330 } ) ;
324- if ( this . props . updateStatusBar ) {
325- if ( IS_ANDROID ) {
326- StatusBar . setBackgroundColor ( this . props . inactiveStatusBarBackgroundColor , true ) ;
327- }
328- StatusBar . setBarStyle ( this . props . inactiveStatusBarStyle , true ) ;
329- }
331+ this . resetStatusBarColor ( ) ;
330332 }
331333 }
332334 animate = toValue => {
0 commit comments