Closed aqos156 closed 5 years ago
In further investigations it seems that iOS (tested on 12.1.2) isn't affected and also at the same time versions of android which do not support custom StatusBar backgroundColor
are not affected. We could make this fix platform specific for android only.
The fix that I presented two days ago fixes this issue on Android and doesn't seem to raise any other issues on iOS (tho not tested thoroughly).
Now when user resets the stack and navigates, the color changes back to default and if the user uses the this.props.navigation.navigate
method, the color of StatusBar stays displayed until the alert automatically hides itself.
@testshallpass Users of may app have found another occourance of this weird behaviour.
You can replicate this by following these steps: Start the example project, trigger a dropdown and hold your finger over it. Now wait untill the dropdown closes itself (you may have to lift your finger and place it back again a few times) The background color of status bar stays set to active.
Tested on android 9.0 Needs more testing
I have added a fix for the issue specified above within the previous pull req.
Short Description
StatusBar
backgroundColor
doesn't change to its default value when moving between screens and reseting the navigator stack via react native navigation.This behaviour could be wanted in a case of having screen where we display the alert and the user navigates at the same time via
this.props.navigation.navigate
, but we still want the user to see that an alert was displayed. So the StatusBarbackgroundColor
changes to indicate that a dropdown was displayed.We generally don't want this behaviour when we are navigating between screens and reseting the navigator stack at the same time. (ex. code to reset stack and navigate to another screen
this.props.navigation.dispatch( StackActions.reset({ index: 0, actions: [ NavigationActions.navigate({ routeName: YOUR_ROUTE_NAME }) ] }) );
)Steps to Reproduce / Code Snippets / Usage
this.props.navigation.dispatch( StackActions.reset({ index: 0, actions: [ NavigationActions.navigate({ routeName: YOUR_ROUTE_NAME }) ] }) );
<StatusBar>
component to this screen with thebackgroundColor
poperty set, then we don't see the dropdown color anymore.)Expected Results
StatusBar color not changing back to its default value
Additional Information