Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

fix: multiselect handling for undefined issues

Ayush Soni8e1a8cea1b7d
diff --git a/packages/form/src/components/MultiSelect.tsx b/packages/form/src/components/MultiSelect.tsx
index 387fa0a2a9..01e68288a9 100644
--- a/packages/form/src/components/MultiSelect.tsx
+++ b/packages/form/src/components/MultiSelect.tsx
@@ -80,7 +80,7 @@ const MultiSelect = ({
return (
<FormControl isInvalid={!!error}>
{label && <FormLabel htmlFor={name}>{label}</FormLabel>}
- {value?.filter(Boolean).map((selection, index) => (
+ {(value ?? []).filter(Boolean).map((selection, index) => (
<input
key={`${name}[${index}]`}
type="hidden"
@@ -91,7 +91,7 @@ const MultiSelect = ({
<MultiSelectBase
{...props}
- value={value?.filter(Boolean)}
+ value={(value ?? []).filter(Boolean)}
inline={props.inline ? MultiSelectPreview : undefined}
onChange={(newValue) => {
setValue(newValue ?? []);