siemiatj / react-native-modal-dropdown

Fork of the original https://github.com/sohobloo/react-native-modal-dropdown
MIT License
119 stars 98 forks source link

Dropdown is not accepting isFullWidth prop #25

Open Stophface opened 3 years ago

Stophface commented 3 years ago

The is not accepting the isFullWidth prop - or I am misunderstanding what it is supposed to do.

<ModalDropdown
        style={buttonStyle}
        dropdownStyle={dropdownStyle}
        textStyle={textStyle}
        dropdownTextStyle={dropdownTextStyle}
        options={['Something long', 'option 2', 'option 3', 'option 4']}
        defaultIndex={1}
        defaultValue='Option 2'
        isFullWidth={true} />

and here is the syling.

const buttonStyle = {
    padding: 5,
    height: 30,
    width: 100,
    backgroundColor: 'white',
    shadowOpacity: 0.29,
    shadowRadius: 14.65,
    elevation: 7,
    display: 'flex',
    justifyContent: 'center',
    alignItems: 'center',
};

const dropdownStyle = {
    height: 200
};

const textStyle = {
    fontSize: 15
};

const dropdownTextStyle = {
    fontSize: 15
};

This is how it looks like

Bildschirmfoto 2021-03-23 um 10 44 32

In my use case even more extreme

Bildschirmfoto 2021-03-23 um 11 23 41

I though the isFullWidth prop tells the <ModalDropdown /> to go over the full width of the <Button>, but it is not. Or do I have to tell the <ModalDropdown /> somewhere else to use the full width of the <Button />? Or can it even adjust automatically to the full width of the text in the dropdown Menu?