From 2e1c0fb77932bdd0681f8d7c9cfd292a9ac52b3b Mon Sep 17 00:00:00 2001 From: it-fixcomart Date: Mon, 11 Nov 2024 14:11:57 +0700 Subject: update undifined select category --- src-migrate/modules/product-detail/components/Information.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src-migrate/modules') diff --git a/src-migrate/modules/product-detail/components/Information.tsx b/src-migrate/modules/product-detail/components/Information.tsx index 590e8afd..3c2eb537 100644 --- a/src-migrate/modules/product-detail/components/Information.tsx +++ b/src-migrate/modules/product-detail/components/Information.tsx @@ -66,7 +66,7 @@ const Information = ({ product }: Props) => { }, [selectedVariant]); const handleOnChange = (vals: any) => { - let code = vals.split(' ')[0]; + let code = vals.replace(/\s-\s.*$/, '').trim(); let variant = variantOptions.find((item) => item.code === code); setSelectedVariant(variant); setInputValue( -- cgit v1.2.3