Fix Variant Details console errors (#742)
* Add default empty unit when there is no specified one * Add index required in draggable tables * Select fields should get undefined value instead of null
This commit is contained in:
parent
287a2eb8ed
commit
7e95d53155
3 changed files with 5 additions and 3 deletions
|
@ -49,7 +49,9 @@ const ProductShipping: React.FC<ProductShippingProps> = props => {
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
InputProps={{
|
InputProps={{
|
||||||
endAdornment: (
|
endAdornment: (
|
||||||
<InputAdornment position="end">{weightUnit}</InputAdornment>
|
<InputAdornment position="end">
|
||||||
|
{weightUnit || ""}
|
||||||
|
</InputAdornment>
|
||||||
),
|
),
|
||||||
inputProps: {
|
inputProps: {
|
||||||
min: 0
|
min: 0
|
||||||
|
|
|
@ -52,7 +52,7 @@ function getAttributeValue(
|
||||||
attributes: VariantAttributeInput[]
|
attributes: VariantAttributeInput[]
|
||||||
): string {
|
): string {
|
||||||
const attribute = attributes.find(attr => attr.id === id);
|
const attribute = attributes.find(attr => attr.id === id);
|
||||||
return attribute.value;
|
return attribute?.value === null ? undefined : attribute.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAttributeValueChoices(
|
function getAttributeValueChoices(
|
||||||
|
|
|
@ -90,7 +90,7 @@ const ProductVariantNavigation: React.FC<ProductVariantNavigationProps> = props
|
||||||
<SortableTableRow
|
<SortableTableRow
|
||||||
hover={!!variant}
|
hover={!!variant}
|
||||||
key={variant ? variant.id : "skeleton"}
|
key={variant ? variant.id : "skeleton"}
|
||||||
index={variantIndex}
|
index={variantIndex || 0}
|
||||||
className={classNames(classes.link, {
|
className={classNames(classes.link, {
|
||||||
[classes.tabActive]: variant && variant.id === current
|
[classes.tabActive]: variant && variant.id === current
|
||||||
})}
|
})}
|
||||||
|
|
Loading…
Reference in a new issue