Use defaultValue instead of selected (#187)

This commit is contained in:
Max 2025-03-13 19:27:56 +01:00 committed by GitHub
parent d987ac816a
commit 0595e54a9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,9 +16,10 @@ const ComboBoxInput = ({ id, options, value, onValueChange }: ComboBoxProps) =>
id={id} id={id}
className='tw-form-select tw-block tw-w-full tw-py-2 tw-px-4 tw-border tw-border-gray-300 rounded-md tw-shadow-sm tw-text-sm focus:tw-outline-none focus:tw-ring-indigo-500 focus:tw-border-indigo-500 sm:tw-text-sm' className='tw-form-select tw-block tw-w-full tw-py-2 tw-px-4 tw-border tw-border-gray-300 rounded-md tw-shadow-sm tw-text-sm focus:tw-outline-none focus:tw-ring-indigo-500 focus:tw-border-indigo-500 sm:tw-text-sm'
onChange={handleChange} onChange={handleChange}
defaultValue={value}
> >
{options.map((o) => ( {options.map((o) => (
<option value={o} key={o} selected={o === value}> <option value={o} key={o}>
{o} {o}
</option> </option>
))} ))}