react-native-dropdown-picker
react-native-dropdown-picker copied to clipboard
DropDownPicker with listMode MODAL changes StatusBar background color
When using DropDownPicker with listMode="MODAL"
, when opening it, it changes the StatusBar background color (in my case, it changes from the custom background color in our app to white).
I tested in iOS.
Example:
const Test = () => {
const [open, setOpen] = React.useState(false);
const [value, setValue] = React.useState(null);
const [items, setItems] = React.useState([
{ label: 'Apple', value: 'apple' },
{ label: 'Banana', value: 'banana' },
{ label: 'Pear', value: 'pear' },
]);
return (
<View style={{ flex: 1 }}>
<View
style={{
flex: 1,
alignItems: 'center',
justifyContent: 'center',
paddingHorizontal: 15,
}}
>
<DropDownPicker
open={open}
value={value}
items={items}
setOpen={setOpen}
setValue={setValue}
setItems={setItems}
placeholder={'Choose a fruit.'}
listMode="MODAL"
/>
</View>
<View
style={{
flex: 1,
alignItems: 'center',
justifyContent: 'center',
}}
>
<Text>Chosen fruit: {value === null ? 'none' : value}</Text>
</View>
</View>
);
};
Expected behaviour:
It shouldn't change the StatusBar background color.