-
-
Notifications
You must be signed in to change notification settings - Fork 188
Closed
Labels
Description
Bug report
Running on the canary release (as encouraged in this request for multi-select dropdowns: #1956), the multiple prop for Select.Root
has the type of true
instead of boolean
, breaking conditional functionality.
Current behavior
SelectRoot.d.ts exports the following incorrect typing for MultipleProps:
interface MultipleProps<Value> extends Omit<Props<Value>, 'multiple' | 'value' | 'defaultValue' | 'onValueChange'> {
/**
* Whether multiple items can be selected.
* @default false
*/
multiple: true;
value?: Value[] | null;
defaultValue?: Value[] | null;
onValueChange?: (value: Value[], event?: Event) => void;
}
Expected behavior
I would expect the multiple prop to be of type boolean, allowing true/false arguments to be passed. When manually changing this type, the typescript engine accepts expressions in the prop.
interface MultipleProps<Value> extends Omit<Props<Value>, 'multiple' | 'value' | 'defaultValue' | 'onValueChange'> {
/**
* Whether multiple items can be selected.
* @default false
*/
multiple: boolean;
value?: Value[] | null;
defaultValue?: Value[] | null;
onValueChange?: (value: Value[], event?: Event) => void;
}
Base UI version
Canary Release (react@9c5f6d4)
Metadata
Metadata
Assignees
Labels
Projects
Status
Done