From a4743b03532226d405ece181b5f701ed176c8bb4 Mon Sep 17 00:00:00 2001 From: Ari Date: Fri, 27 May 2022 12:31:56 -0400 Subject: [PATCH] added helper text for error --- webapp/src/components/Inputs/InputList.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/webapp/src/components/Inputs/InputList.tsx b/webapp/src/components/Inputs/InputList.tsx index ffdcee0..7a837dc 100644 --- a/webapp/src/components/Inputs/InputList.tsx +++ b/webapp/src/components/Inputs/InputList.tsx @@ -1,5 +1,5 @@ import { FC } from "react"; -import FilledInput from '@mui/material/FilledInput'; +import FormHelperText from '@mui/material/FormHelperText'; import InputLabel from '@mui/material/InputLabel'; import MenuItem from '@mui/material/MenuItem'; import FormControl from '@mui/material/FormControl'; @@ -21,12 +21,12 @@ export const InputList: FC> = ({ id, className, }) => { - const invalidCurrent = !options.includes(current); - return + const invalidCurrent = current && !options.includes(current); + return {label} + {invalidCurrent ? `'${current}' is not a valid selection` : ''} // return //