Skip to content

Commit

Permalink
fix(fuselage): Multiselect won't update if value changes (#983)
Browse files Browse the repository at this point in the history
Co-authored-by: Júlia Jaeger Foresti <60678893+juliajforesti@users.noreply.github.com>
  • Loading branch information
MartinSchoeler and juliajforesti authored Mar 23, 2023
1 parent 2f3e080 commit 77a3b9c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/fuselage/src/components/MultiSelect/MultiSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ export const MultiSelect = forwardRef(
const [internalValue, setInternalValue] = useState<SelectOption[0][]>(
value || []
);

useEffect((): void => setInternalValue(value || []), [value]);

const [currentOptionValue, setCurrentOption] = useState<SelectOption[0]>();

const index = options.findIndex(
Expand Down

0 comments on commit 77a3b9c

Please sign in to comment.