Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scroll to mandatory empty fields #8263

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Components/Patient/DailyRounds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import { EncounterSymptomsBuilder } from "../Symptoms/SymptomsBuilder";
import { FieldLabel } from "../Form/FormFields/FormField";
import useAuthUser from "../../Common/hooks/useAuthUser";
import CheckBoxFormField from "../Form/FormFields/CheckBoxFormField";
import { scrollTo } from "../../Utils/utils";

const Loading = lazy(() => import("../Common/Loading"));

Expand Down Expand Up @@ -231,13 +232,15 @@ export const DailyRounds = (props: any) => {
if (!state.form[field]) {
errors[field] = "Please select a category";
invalidForm = true;
scrollTo("patientCategory");
}
return;
case "bp": {
const error = BloodPressureValidator(state.form.bp);
if (error) {
errors.bp = error;
invalidForm = true;
scrollTo("bloodPressure");
}
return;
}
Expand Down Expand Up @@ -524,6 +527,7 @@ export const DailyRounds = (props: any) => {
{...field("patient_category")}
required
label="Category"
id="patientCategory"
/>
</div>
</div>
Expand Down Expand Up @@ -589,7 +593,7 @@ export const DailyRounds = (props: any) => {
<>
<h3 className="mb-6 md:col-span-2">Vitals</h3>

<BloodPressureFormField {...field("bp")} label="Blood Pressure" />
<BloodPressureFormField {...field("bp")} label="Blood Pressure" id="bloodPressure" />

<RangeAutocompleteFormField
{...field("pulse")}
Expand Down
Loading