Skip to content

Commit

Permalink
re-enable save button if handleSubmit did not pass validateForm
Browse files Browse the repository at this point in the history
  • Loading branch information
wang9hu committed Oct 30, 2023
1 parent 7a5e33b commit e9d5b60
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/Timelog/TimeEntryForm/TimeEntryForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,10 @@ const TimeEntryForm = props => {
const minutes = inputs.minutes || 0;
const isTimeModified = edit && (data.hours !== hours || data.minutes !== minutes);

if (!validateForm(isTimeModified)) return;
if (!validateForm(isTimeModified)) {
setSubmitting(false);
return;
}

//Construct the timeEntry object
const timeEntry = {
Expand Down

0 comments on commit e9d5b60

Please sign in to comment.