Closed YoelEigner closed 1 year ago
It's working fine for me, Do you use last version ?
It's working fine for me, Do you use last version ?
Could you please share your component? Or are you referring to the documentation component that’s working fine?
Thank you, but that is not a custom button
a dropdown with a custom button would look like this
<SelectDropdown
data={options}
onSelect={(selectedItem, index) => {
handleChange(selectedItem, index)
}}
defaultValue={1}
selectedRowTextStyle={{ fontFamily: 'Rubik-Bold' }}
ref={dropdownRef}
buttonStyle={{ backgroundColor: 'transparent', width: buttonWidth }}
defaultValueByIndex={1}
renderCustomizedButtonChild={(selectedItem, index) => {
return (
<View style={Styling.customDropDownBtnView}>
<Text
onLayout={handleTextLayout}
style={{ color: '#3994FF', textDecorationLine: 'underline', fontSize: 18, fontFamily: 'Rubik-Medium' }}>
{selectedItem ? selectedItem : 'Choose...'}
</Text>
{ <MaterialCommunityIcons style={{marginTop:2}} name='arrow-down' color={'#3994FF'} size={18} />}
</View>
)
}}
buttonTextAfterSelection={(selectedItem, index) => {
return selectedItem
}}
rowTextForSelection={(item, index) => {
return item
}}
/>
Look at this, I've updated it with an example that has a custom button https://snack.expo.dev/@adelredaa97/default-value
I found the issue, I had a ref in there to reset the selection but when i removed it, the default value does work. Thank you very much
I'm having some issues setting the default value for a custom button whichever prop i try nothing happens
defaultValueByIndex
anddefaultValue
dont work, can this be updated?