File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
src/components/fields/ComboBox Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @cube-dev/ui-kit ' : minor
3
+ ---
4
+
5
+ Fix for Combobox input inside Form.
Original file line number Diff line number Diff line change 5
5
ReactElement ,
6
6
RefObject ,
7
7
useMemo ,
8
+ useState ,
8
9
} from 'react' ;
9
10
import {
10
11
useButton ,
@@ -133,12 +134,17 @@ export const ComboBox = forwardRef(function ComboBox<T extends object>(
133
134
props : CubeComboBoxProps < T > ,
134
135
ref : ForwardedRef < HTMLDivElement > ,
135
136
) {
137
+ const [ , rerender ] = useState ( { } ) ;
138
+
136
139
props = useProviderProps ( props ) ;
137
140
props = useFormProps ( props ) ;
138
141
props = useFieldProps ( props , {
139
142
valuePropsMapper : ( { value, onChange } ) => ( {
140
143
inputValue : value != null ? value : '' ,
141
- onInputChange : ( val ) => onChange ( val , ! props . allowsCustomValue ) ,
144
+ onInputChange : ( val ) => {
145
+ onChange ( val , ! props . allowsCustomValue ) ;
146
+ rerender ( { } ) ;
147
+ } ,
142
148
onSelectionChange : onChange ,
143
149
} ) ,
144
150
} ) ;
You can’t perform that action at this time.
0 commit comments