diff --git a/src/components/picker/PickerItem.js b/src/components/picker/PickerItem.js index 8f44404748..a4ecddafda 100644 --- a/src/components/picker/PickerItem.js +++ b/src/components/picker/PickerItem.js @@ -30,7 +30,7 @@ const PickerItem = props => { } = props; const context = useContext(PickerContext); const {migrate, renderItem} = context; - const isSelected = isItemSelected(value, !migrate && _.isObject(context.value) ? context.value.value : context.value); + const isSelected = isItemSelected(value, !migrate && _.isPlainObject(context.value) ? context.value.value : context.value); const itemLabel = getItemLabel(label, value, props.getItemLabel || context.getItemLabel); const accessibilityProps = { accessibilityState: isSelected ? {selected: true} : undefined, @@ -54,7 +54,7 @@ const PickerItem = props => { if (migrate) { context.onPress(value); } else { - context.onPress(_.isObject(value) ? value : {value, label: itemLabel}); + context.onPress((_.isPlainObject(value) || context.isMultiMode) ? value : {value, label: itemLabel}); } }, [migrate, value, context.onPress]); diff --git a/src/components/picker/index.js b/src/components/picker/index.js index 31f867acb9..5343140f71 100644 --- a/src/components/picker/index.js +++ b/src/components/picker/index.js @@ -213,6 +213,7 @@ class Picker extends PureComponent { migrate, value, onPress: mode === Picker.modes.MULTI ? this.toggleItemSelection : this.onDoneSelecting, + isMultiMode: mode === Picker.modes.MULTI, getItemValue, getItemLabel, onSelectedLayout: this.onSelectedItemLayout,