Open KrisLau opened 2 years ago
Figured it out. I needed to remove the extendableBadgeContainer
prop and just set the container and style props to flex: 1
Jk I thought that worked but when the number of badges is greater than the size of the container it overflows
If you need to modify the style of components which you cannot override via props (e.g [...]Style
or [...]Component
), I believe you must create a custom theme using DropDownPicker.addTheme
and set it via DropDownPicker.setTheme
or the theme
prop.
const baseTheme = (DropDownPicker.THEMES as any).LIGHT;
DropDownPicker.addTheme('mytheme', {
...baseTheme,
default: {
...baseTheme.default,
extendableBadgeContainer: {
...baseTheme.extendableBadgeContainer,
maxHeight: 20
}
} satisfies { [key: string]: ViewStyle }
});
DropDownPicker.setTheme('mytheme');
Docs: https://hossein-zare.github.io/react-native-dropdown-picker-website/docs/advanced/themes
I have a dropdown picker with
extendableBadgeContainer
set totrue
andmaxHeight={20}
but the height isn't working at all.Screenshot: