Skip to content

Commit 77a3b9c

Browse files
fix(fuselage): Multiselect won't update if value changes (#983)
Co-authored-by: Júlia Jaeger Foresti <60678893+juliajforesti@users.noreply.github.com>
1 parent 2f3e080 commit 77a3b9c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/fuselage/src/components/MultiSelect/MultiSelect.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ export const MultiSelect = forwardRef(
7676
const [internalValue, setInternalValue] = useState<SelectOption[0][]>(
7777
value || []
7878
);
79+
80+
useEffect((): void => setInternalValue(value || []), [value]);
81+
7982
const [currentOptionValue, setCurrentOption] = useState<SelectOption[0]>();
8083

8184
const index = options.findIndex(

0 commit comments

Comments
 (0)