@overmap-ai/core 1.0.28-integrate-forms.3 → 1.0.28-integrate-forms.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/overmap-core.js
CHANGED
|
@@ -9647,6 +9647,21 @@ const FormSubmissionBrowser = memo(function FormSubmissionBrowser2(props) {
|
|
|
9647
9647
|
});
|
|
9648
9648
|
const PatchField = memo((props) => {
|
|
9649
9649
|
console.log("PatchField props:", props);
|
|
9650
|
+
const { name, render } = props;
|
|
9651
|
+
const { submitForm } = useFormikContext();
|
|
9652
|
+
const [fieldProps, _meta, helpers] = useField(name);
|
|
9653
|
+
useMemo(() => {
|
|
9654
|
+
const setValue = (value) => {
|
|
9655
|
+
void helpers.setValue(value, false);
|
|
9656
|
+
};
|
|
9657
|
+
return render({
|
|
9658
|
+
value: fieldProps.value,
|
|
9659
|
+
setValue,
|
|
9660
|
+
patchValue: () => {
|
|
9661
|
+
void submitForm();
|
|
9662
|
+
}
|
|
9663
|
+
});
|
|
9664
|
+
}, [submitForm, helpers, fieldProps.value, render]);
|
|
9650
9665
|
return null;
|
|
9651
9666
|
});
|
|
9652
9667
|
PatchField.displayName = "PatchField";
|