Fix checkbox selection
This commit is contained in:
parent
13458a929b
commit
542bda9c47
1 changed files with 20 additions and 12 deletions
|
@ -4,6 +4,7 @@ import makeStyles from "@material-ui/styles/makeStyles";
|
|||
import React from "react";
|
||||
|
||||
import ControlledCheckbox from "@saleor/components/ControlledCheckbox";
|
||||
import Debounce from "@saleor/components/Debounce";
|
||||
import Hr from "@saleor/components/Hr";
|
||||
import Skeleton from "@saleor/components/Skeleton";
|
||||
import { maybe } from "@saleor/misc";
|
||||
|
@ -46,6 +47,11 @@ const ProductVariantCreateValues: React.FC<
|
|||
<Hr className={classes.hr} />
|
||||
<div className={classes.valueContainer}>
|
||||
{attribute.values.map(value => (
|
||||
<Debounce
|
||||
debounceFn={() => onValueClick(attribute.id, value.slug)}
|
||||
time={100}
|
||||
>
|
||||
{change => (
|
||||
<ControlledCheckbox
|
||||
checked={isSelected(
|
||||
value.slug,
|
||||
|
@ -56,9 +62,11 @@ const ProductVariantCreateValues: React.FC<
|
|||
)}
|
||||
name={`value:${value.slug}`}
|
||||
label={value.name}
|
||||
onChange={() => onValueClick(attribute.id, value.slug)}
|
||||
onChange={change}
|
||||
key={value.slug}
|
||||
/>
|
||||
)}
|
||||
</Debounce>
|
||||
))}
|
||||
</div>
|
||||
</React.Fragment>
|
||||
|
|
Loading…
Reference in a new issue