@douglasneuroinformatics/libui 3.8.1 → 3.8.3

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@douglasneuroinformatics/libui",
3
3
  "type": "module",
4
- "version": "3.8.1",
4
+ "version": "3.8.3",
5
5
  "packageManager": "pnpm@9.14.2",
6
6
  "description": "Generic UI components for DNP projects, built using React and Tailwind CSS",
7
7
  "author": "Joshua Unrau",
@@ -101,14 +101,16 @@ const Form = <TSchema extends z.ZodType<FormDataType>, TData extends z.TypeOf<TS
101
101
  };
102
102
 
103
103
  const handleSubmit = async (event: React.FormEvent<HTMLFormElement>) => {
104
- const minSubmitTime = new Promise((resolve) => setTimeout(resolve, 500));
104
+ const minSubmitTime = new Promise<void>((resolve) =>
105
+ suspendWhileSubmitting ? setTimeout(resolve, 500) : resolve()
106
+ );
105
107
  try {
106
108
  setIsSubmitting(true);
107
109
  event.preventDefault();
108
110
  const result = await validationSchema.safeParseAsync(values);
109
111
  if (result.success) {
110
- reset();
111
112
  await onSubmit(result.data);
113
+ reset();
112
114
  } else {
113
115
  console.error(result.error.issues);
114
116
  handleError(result.error);