You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I remove the selected item to see the placeholder? Initially, I can see the placeholder, but after selecting an item there is no way to remove it. I can set the state to undefined but that does not affect the dropdown showing the selected item.
import{SelectList}from'react-native-dropdown-select-list';const[selectedItem,setSelectedItem]=useState<string|undefined>(undefined);<SelectListsetSelected={(key: string)=>setSelectedItem(key)}data={items.map((i)=>({key: I,id,value: i.name}))}save='key'searchPlaceholder='Search items...'placeholder='Select an item'searchicon={<Iconname='magnify'size={25}/>}/><Iconname='delete'size={25} onPress={()=>setSelectedItem(undefined)}/>
I am using "react-native-dropdown-select-list": "^2.0.5"
It is not a fully controlled component. So what would be the mechanism for removing the selected item?
The text was updated successfully, but these errors were encountered:
This is not mentioned in the documentation. However you can reset by using the "defaultOption" just set it to {key: '', value: ''} don't set null value and it works like a charm.
How can I remove the selected item to see the placeholder? Initially, I can see the placeholder, but after selecting an item there is no way to remove it. I can set the state to
undefined
but that does not affect the dropdown showing the selected item.I am using
"react-native-dropdown-select-list": "^2.0.5"
It is not a fully controlled component. So what would be the mechanism for removing the selected item?
The text was updated successfully, but these errors were encountered: