Skip to content

Commit f01bb40

Browse files
committed
fix(Form): internal logic fixes * 10
1 parent f3fe035 commit f01bb40

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/components/fields/ComboBox/ComboBox.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
ReactElement,
66
RefObject,
77
useMemo,
8+
useState,
89
} from 'react';
910
import {
1011
useButton,
@@ -133,12 +134,19 @@ export const ComboBox = forwardRef(function ComboBox<T extends object>(
133134
props: CubeComboBoxProps<T>,
134135
ref: ForwardedRef<HTMLDivElement>,
135136
) {
137+
const [rerender, setRerender] = useState({});
138+
136139
props = useProviderProps(props);
137140
props = useFormProps(props);
138141
props = useFieldProps(props, {
139142
valuePropsMapper: ({ value, onChange }) => ({
140143
inputValue: value != null ? value : '',
141-
onInputChange: (val) => onChange(val, !props.allowsCustomValue),
144+
onInputChange: (val) => {
145+
onChange(val, !props.allowsCustomValue);
146+
if (rerender) {
147+
setRerender({});
148+
}
149+
},
142150
onSelectionChange: onChange,
143151
}),
144152
});

src/components/form/Form/use-form.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,6 @@ export function useForm<TSourceType extends FieldTypes>(
437437
} else {
438438
// Create a new FormInstance if not provided
439439
const forceReRender = () => {
440-
console.log('! rerender');
441440
forceUpdate({});
442441
};
443442

0 commit comments

Comments
 (0)