🐛(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
@@ -76,7 +76,7 @@ export const SelectMultiSearchable = ({ ref, ...props }: SubProps) => {
|
||||
break;
|
||||
}
|
||||
},
|
||||
isItemDisabled: (item) => !!item.disabled,
|
||||
isItemDisabled: (item) => !!item?.disabled,
|
||||
});
|
||||
|
||||
const inputProps = downshiftReturn.getInputProps({
|
||||
|
||||
@@ -88,7 +88,7 @@ export const SelectMultiSimple = ({ ref, ...props }: SubProps) => {
|
||||
break;
|
||||
}
|
||||
},
|
||||
isItemDisabled: (item) => !!item.disabled,
|
||||
isItemDisabled: (item) => !!item?.disabled,
|
||||
});
|
||||
|
||||
const toggleRef = useRef<HTMLElement>(null);
|
||||
|
||||
Reference in New Issue
Block a user