Skip to content

Commit 4fc44f1

Browse files
committed
Fix StatusBar color doesn't reset when holding alert open with finger
1 parent 1d46d8c commit 4fc44f1

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

DropdownAlert.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,14 @@ export default class DropdownAlert extends Component {
272272
);
273273
}
274274
};
275+
resetStatusBarColor = () => {
276+
if (this.props.updateStatusBar) {
277+
if (IS_ANDROID) {
278+
StatusBar.setBackgroundColor(this.props.inactiveStatusBarBackgroundColor, true);
279+
}
280+
StatusBar.setBarStyle(this.props.inactiveStatusBarStyle, true);
281+
}
282+
}
275283
close = action => {
276284
if (action == undefined) {
277285
action = 'programmatic';
@@ -285,15 +293,11 @@ export default class DropdownAlert extends Component {
285293
clearTimeout(this._closeTimeoutId);
286294
}
287295
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-
}
296+
this.resetStatusBarColor();
294297
setTimeout(
295298
function() {
296299
if (this.state.isOpen) {
300+
this.resetStatusBarColor();
297301
this.setState({
298302
isOpen: false,
299303
});
@@ -320,12 +324,7 @@ export default class DropdownAlert extends Component {
320324
this.setState({
321325
isOpen: false,
322326
});
323-
if (this.props.updateStatusBar) {
324-
if (IS_ANDROID) {
325-
StatusBar.setBackgroundColor(this.props.inactiveStatusBarBackgroundColor, true);
326-
}
327-
StatusBar.setBarStyle(this.props.inactiveStatusBarStyle, true);
328-
}
327+
this.resetStatusBarColor();
329328
}
330329
}
331330
animate = toValue => {

0 commit comments

Comments
 (0)