testshallpass / react-native-dropdownalert

An alert to notify users about an error or something else
MIT License
1.85k stars 252 forks source link

StatusBarColor doesn't go back to its original color while typing in TextInput #164

Closed alz10 closed 5 years ago

alz10 commented 5 years ago

Here's my code, it's working perfectly fine, after the DropdownAlert (for example "error" which changes the statusBarBackgroundColor to red) have been shown to the screen, it changes the StatusBarBackgroundColor to its original color of "#2699fb" which is good and what i am expecting to happen but i notice while im typing something in one of my TextInput, it didnt change the StatusBarBackgroundColor to "#2699fb" and remain the color to what ever type of Alert for example "error" which is red, "warn" which is orange, "info" which is blue and so on.......

<DropdownAlert
  ref={ref => (this.dropdown = ref)}
  inactiveStatusBarBackgroundColor="#2699FB"
/>
testshallpass commented 5 years ago

@Albert0405 "while im typing something in one of my TextInput, it didnt change the StatusBarBackgroundColor" I want to clarify this or add steps to reproduce, are you invoking the alert as you type something?

alz10 commented 5 years ago

Im using your DropdownAlert in one of form, let say in Authentication Form. If the user typed nothing in the form then he/she tapped the login button, the DropdownAlert will be open in the screen for example withAlertType of warn and then i suddenly tried to type on the TextInput while the DropdownAlert is still open in the top of the app. When the DropdownAlert was closed after like 4seconds while me typing on my TextInput, it didnt turn the statusBarBackgroundColor to its original color, it changes to orange which is the color of warn im using.

Also i notice while the DropdownAlert is open and you suddenly tried to go back to your previous navigation, it also didnt turn the statusBarBackgroundColor to its original color

While typing in TextInput the color remained orange

ezgif-2-40f6d262359b

While DropdownAlert is open, i tried to tap on my device BackButton and this happens

ezgif-2-b3725f5a0f5c

I tried this solution but didnt work

class TestsComponent extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
       statusbarColor: '#2699fb'
    }
  }

  render() {
    return (
      <View
        style={{
          flex: 1,
          justifyContent: 'center',
          alignItems: 'center',
          backgroundColor: '#2699fb'
        }}
      >
        <StatusBar backgroundColor={this.state.statusBarColor} barStyle="default" />

        <DropdownAlert
          useNativeDriver
          closeInterval={2000}
          ref={ref => (this.dropdown = ref)}
          inactiveStatusBarBackgroundColor="#2699FB"
          onClose={() => this.setState({ statusbarColor: '#2699fb' })}
        />
      </View>
    );
  }
}
testshallpass commented 5 years ago

Possibly related to #169. I need to retest.

testshallpass commented 5 years ago

I was unable to reproduce using: