Closed jgudo closed 3 years ago
Try add renderRowProps={{ underlayColor: 'lightgray' }}
to ModalDropDown
@bulent-eroglu It worked! Thanks! I wonder if also there exist a prop for setting the style of active/selected item. Something like
renderRowProps={{ underlayColor: 'lightgray', selectedUnderlayColor: 'lightgray' }}
Not sure if there is a prop for setting the style for active/selected item but I managed to do it with this:
const [selected, setSelected] = useState<IOption | null>(null);
const onSelectChange = (index: string, option: IOption) => {
setSelected(option);
}
<ModalDropdown
...
onSelect={onSelectChange}
renderRowProps={{ underlayColor: 'lightgray' }}
renderRow={((option: IOption) => (
<Text style={[styles.dropdownText, { backgroundColor: selected?.value === option.value ? '#cacaca' : '#fff' }]}>
{option.label}
</Text>
))}
>
...
</ModalDropdown>
Is it possible to customize the the style of active/selected dropdown item?
I have this simple setup of dropdown
However, upon selecting an item, the item's background color changes to black making it unreadable. There's also no cue for selected/active item.