react-native-ui-lib
react-native-ui-lib copied to clipboard
Picker issue
Description
When using the Picker component it only allows one on multi selection.
Related to
- [X] Components
- [ ] Demo
- [ ] Docs
- [ ] Typings
Steps to reproduce
simple multi select setup
Expected behavior
Should allow for multiple selections unless i'm doing some thing wrong..
Actual behavior
Press one option then tap second item and first is deselected and second isn't selected either. The third item would then be selected and repeat.
More Info
Code snippet
function Options() {
const options = useOptions(); //array of objects
const [selectedOptions, setSelectedOptions] = useState<string[]>([])
return (
<View>
<Picker
value={selectedOptions}
placeholder={'Select By Options'}
mode={PickerModes.MULTI}
showSearch={true}
migrateTextField
onChange={(items:string[]) => setSelectedOptions(items)}
>
{options.map((item,i)=>(
<Picker.Item key={item.id} value={item.id} label={`item: ${i}`} disabled={false}/>
))}
</Picker>
</View>
)
}
Screenshots/Video

Environment
- React Native version: 0.69.5
- React Native UI Lib version: 6.21.2
Affected platforms
- [?] Android
- [X] iOS
- [?] Web