Skip to content

Commit 165ffea

Browse files
treodenclaude
andcommitted
fix(catalog): guard undefined value in variant option filter
The variant option filter Select could pass `undefined` to `onValueChange` (e.g. when cleared), storing `undefined` as the filter value. Treat a falsy value the same as `all` — clear the filter. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 3b0c8ef commit 165ffea

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • packages/evershop/src/modules/catalog/pages/admin/productEdit/variants

packages/evershop/src/modules/catalog/pages/admin/productEdit/variants/Variants.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ export const Variants: React.FC<VariantsProps> = ({
213213
onValueChange={(value) =>
214214
setOptionFilters((prev) => ({
215215
...prev,
216-
[attribute.attributeCode]: value === 'all' ? '' : value
216+
[attribute.attributeCode]:
217+
!value || value === 'all' ? '' : value
217218
}))
218219
}
219220
>

0 commit comments

Comments
 (0)