Skip to content

Commit dda1be5

Browse files
lixiaoyanclaude
andauthored
fix: allow null value in ComboBox validate for single selection (adobe#9742)
Since ComboBox supports allowsCustomValue, the validate function can be called with an empty selection in single mode. Update ValidationType to include null for single selection to match the runtime behavior. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent cc6d6a9 commit dda1be5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/@react-types/combobox/src/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export type MenuTriggerAction = 'focus' | 'input' | 'manual';
3737
export type SelectionMode = 'single' | 'multiple';
3838
export type ValueType<M extends SelectionMode> = M extends 'single' ? Key | null : readonly Key[];
3939
export type ChangeValueType<M extends SelectionMode> = M extends 'single' ? Key | null : Key[];
40-
type ValidationType<M extends SelectionMode> = M extends 'single' ? Key : Key[];
40+
type ValidationType<M extends SelectionMode> = M extends 'single' ? Key | null : Key[];
4141

4242
export interface ComboBoxValidationValue<M extends SelectionMode = 'single'> {
4343
/**

0 commit comments

Comments
 (0)