react-native-dropdown-picker icon indicating copy to clipboard operation
react-native-dropdown-picker copied to clipboard

DropDownPicker style={{height: ?}} doesnt work

Open romanpappinen opened this issue 3 years ago • 8 comments

Hello,

I have - "react-native-dropdown-picker": "^5.1.19", There is that problem, by default main input container height is somethink about 40, i want to set it 35, couse i have other buttons, and i want them to same style... But it doesnt work. containerStyle is possible to change height. Tried to put paddings and margins for 0, doesnt help. Whats propblem there can be ?

romanpappinen avatar Aug 25 '22 08:08 romanpappinen

@LyrranKelmalu Can you try setting minHeight for the dropdown styling to the number you want?

parsa-j42 avatar Aug 25 '22 16:08 parsa-j42

@parsa-j42 yea i tried, it doesnt help. There is some problem with parent container, becouse when i put dropdows outside of it, that works. =(

So i have

<View> <ScrollView> ...stuff inside.... <ScrollView> <DropDownPicker open={open} value={value} items={provinces} placeholder="Maakunnat..." containerStyle={open ? styles.dropDownContOpen : styles.dropDownContClose} style={styles.dropDownStyle} dropDownContainerStyle={styles.dropDownContainerStyle} placeholderStyle={{height: 35}} arrowIconStyle={styles.arrowIconStyle} onChangeValue={(value) => { filterArrByProvince(value); }} setOpen={setOpen} setValue={setValue} setItems={setProvinces} /> </View>

Here is the styles:

dropDownContClose: { borderRadius: 25, width: 150, height: 35, backgroundColor: '#FFF' }, dropDownContOpen: { borderRadius: 25, borderBottomStartRadius: 0, borderBottomEndRadius: 0, width: 150, height: 35, backgroundColor: '#FFF', }, arrowIconStyle: { width: 20, height: 20, marginBottom: 15 }, dropDownStyle: { borderRadius: 25, borderWidth: 0, backgroundColor: 'transparent', height: 22 }, dropDownContainerStyle: { borderWidth: 0, marginTop: -14, borderBottomStartRadius: 25, borderBottomEndRadius: 25 },

romanpappinen avatar Aug 26 '22 06:08 romanpappinen

@parsa-j42 And i get that done, by assign transparency to dropdown container, but after it list buttonst doesnt work, so i cant chose value from list.

romanpappinen avatar Aug 26 '22 06:08 romanpappinen

Changed for modal, it works fine and i can implement it in app.

romanpappinen avatar Aug 26 '22 06:08 romanpappinen

Hi! i found this issue also, but i manage to found the containerProps and the the dinamic height there.

it works good. image

gioanrobles24 avatar Sep 05 '22 16:09 gioanrobles24

minHeight worked for me dropDownContainerStyle={{minHeight: 200}}

jaswanthmagure avatar Sep 13 '22 08:09 jaswanthmagure

minHeight worked for me dropDownContainerStyle={{minHeight: 200}}

That was awesome, worked!!!

zeealik avatar Nov 17 '22 22:11 zeealik

@LyrranKelmalu Can you try setting minHeight for the dropdown styling to the number you want?

For me it worked

criss02-cs avatar Nov 25 '22 14:11 criss02-cs