From 87a4dcefdd501204640a4c2a491e428109a5b84c Mon Sep 17 00:00:00 2001 From: RustamRu Date: Sat, 8 Mar 2025 20:35:06 +0300 Subject: [PATCH] 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 --- .../order-form/form/car-body/car-body-select.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/order-form/form/car-body/car-body-select.tsx b/src/components/order-form/form/car-body/car-body-select.tsx index ba14f66..50602ab 100644 --- a/src/components/order-form/form/car-body/car-body-select.tsx +++ b/src/components/order-form/form/car-body/car-body-select.tsx @@ -21,9 +21,10 @@ import { CarBodySelectProps } from './types'; export const CarBodySelect = forwardRef( 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); + onClose(); }; const { value, getRadioProps, getRootProps } = useRadioGroup({