From 1bfa0119b580337cecbd3e268bb1ff5a9e2d52b4 Mon Sep 17 00:00:00 2001 From: cond0r Date: Fri, 28 May 2021 16:47:02 +0300 Subject: [PATCH] Update Swatch.tsx --- components/product/Swatch/Swatch.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/product/Swatch/Swatch.tsx b/components/product/Swatch/Swatch.tsx index 7e8de3e4a..664b24f3c 100644 --- a/components/product/Swatch/Swatch.tsx +++ b/components/product/Swatch/Swatch.tsx @@ -44,14 +44,15 @@ const Swatch: FC & SwatchProps> = ({ className={swatchClassName} style={color ? { backgroundColor: color } : {}} aria-label="Variant Swatch" + {...(label && color && { title: label })} {...props} > - {variant === 'color' && active && ( + {variant === 'color' && color && active && ( )} - {variant !== 'color' ? label : null} + {variant !== 'color' || !color ? label : null} ) }