Closed sanket-3101 closed 3 years ago
There are new props in v1.0.3 dropDownStyle & dropDownItemStyle that can help with your case
Thanks 👍
On Wed, Jun 9, 2021, 00:21 Fateh Farooqui @.***> wrote:
There are new props in v1.0.3 dropDownStyle & dropDownItemStyle that can help with your case
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/fateh999/react-native-paper-dropdown/issues/12#issuecomment-857011726, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANVP5LKPJNXHLPFM73KCX23TRZRCPANCNFSM45PLBNOA .
It's not possible to change the background color of a "closed" dropdown, even with dropDownStyle and dropDownItemStyle. The surface color only works with background of the "menu" (after click on down arrow of dropdown).
Thanks @tobecwb that's very unfortunate. Means I will have to look for another library.
since it uses paper's color.background:
const myTheme = useTheme() const customTheme = { ...myTheme, colors: { ...myTheme.colors, background: '#ffffff', // white background when closed }, }
<Dropdown theme={customTheme} />
this code worked for me to change background color of the dropdown. -react native paper dropdown
<DropDown
// label={'P'}
mode={'outlined'}
visible={showMobileDropDOwn}
showDropDown={() => setShowMobileDropDOwn(true)}
onDismiss={() => setShowMobileDropDOwn(false)}
setValue={setPhoneCountry}
value={phoneCountry}
list={codes}
inputProps={{
style:{
width:90,
backgroundColor: 'rgb(252,243,207)',
height:20
}
}}
/>
Hi, I was just wondering the same. It uses the
surface
color, so simply change that in your theme.