From 06de15a65505cb45e982edb1bd07b5701c5073b5 Mon Sep 17 00:00:00 2001 From: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> Date: Fri, 23 Aug 2024 03:47:36 +0530 Subject: [PATCH] fix the unknown option in rhythm --- src/Components/LogUpdate/Sections/Vitals.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Components/LogUpdate/Sections/Vitals.tsx b/src/Components/LogUpdate/Sections/Vitals.tsx index 796575e4145..3fbc26c6b70 100644 --- a/src/Components/LogUpdate/Sections/Vitals.tsx +++ b/src/Components/LogUpdate/Sections/Vitals.tsx @@ -15,7 +15,7 @@ import PainChart from "../components/PainChart"; import { LogUpdateSectionMeta, LogUpdateSectionProps } from "../utils"; const Vitals = ({ log, onChange }: LogUpdateSectionProps) => { - const handleBloodPressureChange = (event: FieldChangeEvent) => { + const handleBloodPressureChange = (event: FieldChangeEvent) => { const bp = { ...(log.bp ?? {}), [event.name]: event.value, @@ -146,9 +146,10 @@ const Vitals = ({ log, onChange }: LogUpdateSectionProps) => { optionDisplay={(c) => c.label} optionValue={(c) => c.value || ""} value={log.rhythm} - onChange={(c) => - onChange({ rhythm: c.value as DailyRoundsModel["rhythm"] }) - } + onChange={(c) => { + const newValue = c.value === null ? undefined : c.value; + onChange({ rhythm: newValue as DailyRoundsModel["rhythm"] }); + }} />