fix: Improve car body select event handling

- Updated CarBodySelect to properly emit change events
- Added onClose() call to close the select dropdown after selection
- Removed TypeScript ignore comment by properly typing the onChange event
This commit is contained in:
RustamRu 2025-03-08 20:35:06 +03:00
parent 0679ad92ef
commit 87a4dcefdd

View File

@ -21,9 +21,10 @@ import { CarBodySelectProps } from './types';
export const CarBodySelect = forwardRef<HTMLInputElement, CarBodySelectProps>(
function CarBodySelect(props, ref) {
const handleOptionClick: UseRadioGroupProps['onChange'] = (value) => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
props.onChange(value);
props.onChange({
target: { value },
} as React.ChangeEvent<HTMLInputElement>);
onClose();
};
const { value, getRadioProps, getRootProps } = useRadioGroup({