This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commit 4842ca7 committed Jan 22, 2025 · 16 / 16 · Verified
1 parent 1bf3e1c commit 4842ca7 Copy full SHA for 4842ca7
File tree 4 files changed +4
-4
lines changed
packages/components/src/components/Select
4 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export type ComboboxProps = {
22
22
/**
23
23
* The active value in the combobox component. This is used to control the combobox externally.
24
24
*/
25
- value ?: string ;
25
+ value ?: string | null ;
26
26
/**
27
27
* The default value of the combobox component. Used for uncontrolled usages.
28
28
*/
Original file line number Diff line number Diff line change @@ -240,7 +240,7 @@ export const ExternallyControlled: Story = {
240
240
} ,
241
241
] ,
242
242
render : ( args ) => {
243
- const [ activeItem , setActiveItem ] = useState < string > ( ) ;
243
+ const [ activeItem , setActiveItem ] = useState < string | null > ( ) ;
244
244
return (
245
245
< >
246
246
< Select
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export type SelectComponentProps = {
25
25
/**
26
26
* The active value in the select component. This is used to control the select externally.
27
27
*/
28
- value ?: string ;
28
+ value ?: string | null ;
29
29
/**
30
30
* The default value of the select component. Used for uncontrolled usages.
31
31
*/
Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ export const useSelectData = (children: ReactNode) => {
93
93
) ;
94
94
95
95
const getItemByValue = useCallback (
96
- ( value ?: string ) => ( value ? itemValues . find ( ( item ) => item . value === value ) : undefined ) ,
96
+ ( value ?: string | null ) => ( value ? itemValues . find ( ( item ) => item . value === value ) : undefined ) ,
97
97
[ itemValues ] ,
98
98
) ;
99
99
You can’t perform that action at this time.
0 commit comments