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:
parent
0679ad92ef
commit
87a4dcefdd
@ -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({
|
||||
|
Loading…
x
Reference in New Issue
Block a user