Closed o-murphy closed 7 months ago
For accepting native margins for the DropDown component
Add this please
const DropDown = forwardRef((props, ref) => {
const activeTheme = useTheme();
const { multiSelect = false, visible, onDismiss, showDropDown, value, setValue,
activeColor, mode, label, placeholder, inputProps, list, dropDownContainerMaxHeight,
dropDownContainerHeight, theme, dropDownStyle, dropDownItemStyle, dropDownItemSelectedStyle,
dropDownItemTextStyle, dropDownItemSelectedTextStyle, accessibilityLabel,
inputStyle // the text input style
} = props;
And this
<TextInput
style={inputStyle}
value={displayValue}
mode={mode} label={label}
placeholder={placeholder}
pointerEvents={"none"}
theme={theme}
right={<TextInput.Icon name={visible ? "menu-up" : "menu-down"}/>} {...inputProps}
/>
This change apply to use it as is
<CustomDropDown
label={label}
mode={"outlined"}
visible={showDropDown}
showDropDown={() => setShowDropDown(true)}
onDismiss={() => setShowDropDown(false)}
value={unit}
setValue={setUnit}
list={unitList}
inputStyle={{
marginVertical: 10
}}
/>
sorry i forgot about inputProps property
https://github.com/callstack/react-native-paper/pull/2997