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/index.js CHANGED
@@ -1895,7 +1895,10 @@ var useFormWithEditState = ({
1895
1895
  }
1896
1896
  }, [onToggleEdit]);
1897
1897
  const handleSave = useCallback(async () => {
1898
- if (!isValid) return;
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, isValid, onSave, onToggleEdit]);
1918
+ }, [form, onSave, onToggleEdit]);
1916
1919
  const handleCancel = useCallback(() => {
1917
1920
  reset();
1918
1921
  if (onCancel) {