diff --git a/src/components/Picker.js b/src/components/Picker.js index 3257712..0b06940 100644 --- a/src/components/Picker.js +++ b/src/components/Picker.js @@ -1264,7 +1264,7 @@ function Picker({ // Not a reliable method for external value changes. if (multiple) { - if (memoryRef.current.value.includes(item[_schema.value])) { + if (memoryRef.current.value?.includes(item[_schema.value])) { const index = memoryRef.current.items.findIndex(x => x[_schema.value] === item[_schema.value]); if (index > -1) { @@ -1280,7 +1280,7 @@ function Picker({ setValue(state => { if (multiple) { - let _state = state !== null ? [...state] : []; + let _state = state !== null && state !== undefined ? [...state] : []; if (_state.includes(item[_schema.value])) { // Remove the value