Open taichan03 opened 3 months ago
Anyone can pick this up!
Hi,
I looked into this bug and it seems to be caused by the form not having a value set in the "Current State" field.
If you select an option, the form will submit on the first time. However if you skip it, maybe because 'Manic' is the correct option that you wanted, the form has the value saved as null
and then it runs through this code in the handleSubmit
function
// Check if Diagnosis is "Null"
if (newPatientInfo.Diagnosis === "Null") {
newPatientInfo.Diagnosis = "Manic";
// setErrors(["Please select a current state."]);
// window.scrollTo({ top: 0, behavior: "smooth" });
return; // Prevent form submission
}
I propose 2 options to solve this:
I'm not familiar enough with the application to say which route we should take. Both are fairly easy to implement so please let me know and I would be happy to help.
@snaeem3 you are awesome! Thank you for looking into this and proposing solutions. Let's go with Solution 1. Let's also remove null as an option, in this case.
BUG When users click submit on the New patient form, sometimes they have to click twice. We would like to fix it so that it will work with one click.