braid-ui 1.0.44 → 1.0.45
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/css/braid-ui.css +4 -0
- package/dist/css/braid-ui.min.css +1 -1
- package/dist/index.cjs +5 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1895,7 +1895,10 @@ var useFormWithEditState = ({
|
|
|
1895
1895
|
}
|
|
1896
1896
|
}, [onToggleEdit]);
|
|
1897
1897
|
const handleSave = useCallback(async () => {
|
|
1898
|
-
|
|
1898
|
+
const isFormValid = await form.trigger();
|
|
1899
|
+
if (!isFormValid) {
|
|
1900
|
+
return;
|
|
1901
|
+
}
|
|
1899
1902
|
setIsLoading(true);
|
|
1900
1903
|
try {
|
|
1901
1904
|
const data = form.getValues();
|
|
@@ -1912,7 +1915,7 @@ var useFormWithEditState = ({
|
|
|
1912
1915
|
} finally {
|
|
1913
1916
|
setIsLoading(false);
|
|
1914
1917
|
}
|
|
1915
|
-
}, [form,
|
|
1918
|
+
}, [form, onSave, onToggleEdit]);
|
|
1916
1919
|
const handleCancel = useCallback(() => {
|
|
1917
1920
|
reset();
|
|
1918
1921
|
if (onCancel) {
|