- fix on change set Field value issues

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-02-21 14:29:56 -05:00
parent b63602143e
commit 2a45be6a45

View File

@@ -133,7 +133,6 @@ function FiltersSection({filters, form, bodyshop}) {
}; };
const reflections = reflector ? generateReflections(reflector) : []; const reflections = reflector ? generateReflections(reflector) : [];
const fieldPath = [[field.name, "value"]]; const fieldPath = [[field.name, "value"]];
if (reflections.length > 0) { if (reflections.length > 0) {
@@ -142,7 +141,7 @@ function FiltersSection({filters, form, bodyshop}) {
options={reflections} options={reflections}
getPopupContainer={trigger => trigger.parentNode} getPopupContainer={trigger => trigger.parentNode}
onChange={(value) => { onChange={(value) => {
form.setFieldsValue({[fieldPath.join('.')]: value}); form.setFieldValue(fieldPath, value);
}} }}
/> />
); );
@@ -151,13 +150,13 @@ function FiltersSection({filters, form, bodyshop}) {
if (type === "number") { if (type === "number") {
return ( return (
<InputNumber <InputNumber
onChange={(value) => form.setFieldValue(fieldPath, parseInt(value, 10))}/> onChange={(value) => form.setFieldValue(fieldPath, value)}/>
); );
} }
return ( return (
<Input <Input
onChange={(e) => form.setFieldsValue(fieldPath, e.target.value)}/> onChange={(e) => form.setFieldValue(fieldPath, e.target.value)}/>
); );
})() })()
} }