diff --git a/packages/web/src/components/ControlledAutocomplete/index.jsx b/packages/web/src/components/ControlledAutocomplete/index.jsx index 31a14b55..b48a45e8 100644 --- a/packages/web/src/components/ControlledAutocomplete/index.jsx +++ b/packages/web/src/components/ControlledAutocomplete/index.jsx @@ -4,6 +4,7 @@ import { Controller, useFormContext } from 'react-hook-form'; import FormHelperText from '@mui/material/FormHelperText'; import Autocomplete, { createFilterOptions } from '@mui/material/Autocomplete'; import Typography from '@mui/material/Typography'; +import { Option } from './style'; const getOption = (options, value) => options.find((option) => option.value === value) || null; @@ -95,19 +96,27 @@ function ControlledAutocomplete(props) { ref={ref} data-test={`${name}-autocomplete`} renderOption={(optionProps, option) => ( -
  • - {option.label} + + {option.label} + {showOptionValue && typeof option.value === 'string' && ( - {option.value} + + {option.value} + )} -
  • + )} renderInput={(params) => renderInput(params, fieldState)} + {...(showOptionValue && { ListboxProps: { sx: { p: 0 } } })} /> {showHelperText && ( prop !== 'showOptionValue', +})(({ theme, showOptionValue }) => ({ + ...(showOptionValue && { + borderBottom: `1px solid ${theme.palette.divider}`, + flexDirection: 'column', + alignItems: 'start !important', + padding: `${theme.spacing(2)} !important`, + }), +}));