Skip to content

Commit 82e8173

Browse files
authored
Merge pull request hossein-zare#565 from medmo7/dev-5.x
Fix: select item multiple enabled
2 parents d644bef + 3ce3904 commit 82e8173

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/Picker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,7 @@ function Picker({
12641264

12651265
// Not a reliable method for external value changes.
12661266
if (multiple) {
1267-
if (memoryRef.current.value.includes(item[_schema.value])) {
1267+
if (memoryRef.current.value?.includes(item[_schema.value])) {
12681268
const index = memoryRef.current.items.findIndex(x => x[_schema.value] === item[_schema.value]);
12691269

12701270
if (index > -1) {
@@ -1280,7 +1280,7 @@ function Picker({
12801280

12811281
setValue(state => {
12821282
if (multiple) {
1283-
let _state = state !== null ? [...state] : [];
1283+
let _state = state !== null && state !== undefined ? [...state] : [];
12841284

12851285
if (_state.includes(item[_schema.value])) {
12861286
// Remove the value

0 commit comments

Comments
 (0)