From 4849cef859c2e03be5b1db489776baf01af7cafe Mon Sep 17 00:00:00 2001 From: Wendy Date: Fri, 4 Oct 2024 14:23:09 -0700 Subject: [PATCH] Format selected value --- client/src/pages/patients/inputs/HealthcareChoicesSearch.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/pages/patients/inputs/HealthcareChoicesSearch.jsx b/client/src/pages/patients/inputs/HealthcareChoicesSearch.jsx index 575c55b1..b7355595 100644 --- a/client/src/pages/patients/inputs/HealthcareChoicesSearch.jsx +++ b/client/src/pages/patients/inputs/HealthcareChoicesSearch.jsx @@ -72,7 +72,7 @@ export default function HealthcareChoicesSearch({ form, choice, initialData }) { }; const handleSelectValue = (id, key) => { - const name = key.children; + const name = key.children.filter( el => el !== undefined).join('').trim(); setValue({ id, name }); setSearch(name); form.setFieldValue(`healthcareChoices.${choice}Id`, id);