Skip to content

Commit 310672f

Browse files
fix: reapply MultiSelectCombobox value prop initialization
Ensures that when using the value prop (controlled mode), the component properly initializes with the provided selected options on first render. This was reverted in the previous commit but is needed for the fix. Co-authored-by: jaaydenh <1858163+jaaydenh@users.noreply.github.com>
1 parent c543643 commit 310672f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

site/src/components/MultiSelectCombobox/MultiSelectCombobox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ export const MultiSelectCombobox = forwardRef<
215215
const dropdownRef = useRef<HTMLDivElement>(null);
216216

217217
const [selected, setSelected] = useState<Option[]>(
218-
arrayDefaultOptions ?? [],
218+
value ?? arrayDefaultOptions ?? [],
219219
);
220220
const [options, setOptions] = useState<GroupOption>(
221221
transitionToGroupOption(arrayDefaultOptions, groupBy),

0 commit comments

Comments
 (0)