Skip to content

Commit

Permalink
Handle case where multi is true and value is not an array.
Browse files Browse the repository at this point in the history
  • Loading branch information
T4rk1n committed Mar 15, 2022
1 parent bfa9f54 commit 411f349
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const Dropdown = props => {
useEffect(() => {
if (optionsCheck !== sanitizedOptions && !isNil(value)) {
const values = sanitizedOptions.map(option => option.value);
if (multi) {
if (multi && Array.isArray(value)) {
const invalids = value.filter(v => !values.includes(v));
if (invalids.length) {
setProps({value: without(invalids, value)});
Expand Down

0 comments on commit 411f349

Please sign in to comment.