🐛(react) prevent error on searchable select
When a select is searchable, when the user search term but this one return no items, currently the component raise an error.
This commit is contained in:
committed by
Jean-Baptiste PENRATH
parent
a343db2b0e
commit
e9a85ee63f
5
.changeset/social-cougars-glow.md
Normal file
5
.changeset/social-cougars-glow.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@openfun/cunningham-react": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
prevent error on searchable select
|
||||||
@@ -76,7 +76,7 @@ export const SelectMultiSearchable = ({ ref, ...props }: SubProps) => {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isItemDisabled: (item) => !!item.disabled,
|
isItemDisabled: (item) => !!item?.disabled,
|
||||||
});
|
});
|
||||||
|
|
||||||
const inputProps = downshiftReturn.getInputProps({
|
const inputProps = downshiftReturn.getInputProps({
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ export const SelectMultiSimple = ({ ref, ...props }: SubProps) => {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isItemDisabled: (item) => !!item.disabled,
|
isItemDisabled: (item) => !!item?.disabled,
|
||||||
});
|
});
|
||||||
|
|
||||||
const toggleRef = useRef<HTMLElement>(null);
|
const toggleRef = useRef<HTMLElement>(null);
|
||||||
|
|||||||
Reference in New Issue
Block a user