Skip to content

Commit

Permalink
🪟 🎉 Add a loading spinner to the user input form submit button (#12147)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmossman committed Apr 17, 2024
1 parent 702c7b7 commit 9e404ba
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ const InputModal = ({
onSubmit: (inputInEditing: InputInEditing) => void;
}) => {
const {
formState: { isValid },
formState: { isValid, isSubmitting },
setValue,
handleSubmit,
} = useFormContext<InputInEditing>();
Expand Down Expand Up @@ -411,7 +411,7 @@ const InputModal = ({
<Button variant="secondary" type="reset" onClick={onClose}>
<FormattedMessage id="form.cancel" />
</Button>
<Button type="submit" disabled={!isValid}>
<Button type="submit" disabled={!isValid} isLoading={isSubmitting}>
<FormattedMessage id={inputInEditing.isNew ? "form.create" : "form.saveChanges"} />
</Button>
</ModalFooter>
Expand Down

0 comments on commit 9e404ba

Please sign in to comment.