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}
|
||||
InputProps={{
|
||||
endAdornment: (
|
||||
<InputAdornment position="end">{weightUnit}</InputAdornment>
|
||||
<InputAdornment position="end">
|
||||
{weightUnit || ""}
|
||||
</InputAdornment>
|
||||
),
|
||||
inputProps: {
|
||||
min: 0
|
||||
|
|
|
@ -52,7 +52,7 @@ function getAttributeValue(
|
|||
attributes: VariantAttributeInput[]
|
||||
): string {
|
||||
const attribute = attributes.find(attr => attr.id === id);
|
||||
return attribute.value;
|
||||
return attribute?.value === null ? undefined : attribute.value;
|
||||
}
|
||||
|
||||
function getAttributeValueChoices(
|
||||
|
|
|
@ -90,7 +90,7 @@ const ProductVariantNavigation: React.FC<ProductVariantNavigationProps> = props
|
|||
<SortableTableRow
|
||||
hover={!!variant}
|
||||
key={variant ? variant.id : "skeleton"}
|
||||
index={variantIndex}
|
||||
index={variantIndex || 0}
|
||||
className={classNames(classes.link, {
|
||||
[classes.tabActive]: variant && variant.id === current
|
||||
})}
|
||||
|
|
Loading…
Reference in a new issue