[questions][fix] disallow unnamed lists

pull/531/head
Jeff Sieu 2 years ago
parent 964f791e46
commit d54586fbfe

@ -21,7 +21,7 @@ export default function CreateListDialog({
const { const {
register: formRegister, register: formRegister,
handleSubmit, handleSubmit,
formState: { isSubmitting }, formState: { isSubmitting, isDirty },
reset, reset,
} = useForm<CreateListFormData>(); } = useForm<CreateListFormData>();
const register = useFormRegister(formRegister); const register = useFormRegister(formRegister);
@ -51,6 +51,7 @@ export default function CreateListDialog({
autoComplete="off" autoComplete="off"
label="Name" label="Name"
placeholder="List name" placeholder="List name"
required={true}
type="text" type="text"
/> />
</div> </div>
@ -62,6 +63,7 @@ export default function CreateListDialog({
onClick={handleDialogCancel} onClick={handleDialogCancel}
/> />
<Button <Button
disabled={!isDirty}
display="inline" display="inline"
isLoading={isSubmitting} isLoading={isSubmitting}
label="Create" label="Create"

Loading…
Cancel
Save