diff --git a/src/Components/Input/ComboBoxInput.tsx b/src/Components/Input/ComboBoxInput.tsx index 398e8005..b60d7324 100644 --- a/src/Components/Input/ComboBoxInput.tsx +++ b/src/Components/Input/ComboBoxInput.tsx @@ -7,8 +7,7 @@ interface ComboBoxProps { const ComboBoxInput = ({ id, options, value, onValueChange }: ComboBoxProps) => { const handleChange = (e: React.ChangeEvent) => { - const value = e.target.value - onValueChange(value) + onValueChange(e.target.value) } return ( @@ -16,7 +15,7 @@ const ComboBoxInput = ({ id, options, value, onValueChange }: ComboBoxProps) => 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 tw:focus:outline-hidden tw:focus:ring-indigo-500 tw:focus:border-indigo-500 tw:sm:text-sm' onChange={handleChange} - defaultValue={value} + value={value} // ← hier controlled statt defaultValue > {options.map((o) => (