From 0f05674c38869ebc4984730a6afc7dc4b10c06bb Mon Sep 17 00:00:00 2001 From: Xiaoyan Li Date: Thu, 5 Mar 2026 17:24:59 +0800 Subject: [PATCH 1/2] fix: pass selection mode generic to ComboBox validate type ComboBoxProps was using `Validation` without passing the `M` generic, so the validate callback's `value` field was always typed as `Key` (single mode) even with `selectionMode="multiple"`. Co-Authored-By: Claude Opus 4.6 --- packages/@react-types/combobox/src/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@react-types/combobox/src/index.d.ts b/packages/@react-types/combobox/src/index.d.ts index 7a00ecf44f6..c788543184f 100644 --- a/packages/@react-types/combobox/src/index.d.ts +++ b/packages/@react-types/combobox/src/index.d.ts @@ -50,7 +50,7 @@ export interface ComboBoxValidationValue { inputValue: string } -export interface ComboBoxProps extends CollectionBase, InputBase, ValueBase>, TextInputBase, Validation, FocusableProps, LabelableProps, HelpTextProps { +export interface ComboBoxProps extends CollectionBase, InputBase, ValueBase>, TextInputBase, Validation>, FocusableProps, LabelableProps, HelpTextProps { /** The list of ComboBox items (uncontrolled). */ defaultItems?: Iterable, /** The list of ComboBox items (controlled). */ From 902b343865f7bde41a01bff8d11d9824b3fe73f8 Mon Sep 17 00:00:00 2001 From: Xiaoyan Li Date: Thu, 5 Mar 2026 19:02:11 +0800 Subject: [PATCH 2/2] fix: allow null value in ComboBox validate for single selection 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 --- packages/@react-types/combobox/src/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@react-types/combobox/src/index.d.ts b/packages/@react-types/combobox/src/index.d.ts index c788543184f..1b37619c741 100644 --- a/packages/@react-types/combobox/src/index.d.ts +++ b/packages/@react-types/combobox/src/index.d.ts @@ -36,7 +36,7 @@ import { export type MenuTriggerAction = 'focus' | 'input' | 'manual'; export type SelectionMode = 'single' | 'multiple'; export type ValueType = M extends 'single' ? Key | null : Key[]; -type ValidationType = M extends 'single' ? Key : Key[]; +type ValidationType = M extends 'single' ? Key | null : Key[]; export interface ComboBoxValidationValue { /**