From ed2b46d96b16ed23cd55f748e9faf5e91ccfa3c9 Mon Sep 17 00:00:00 2001 From: Michael Novotny Date: Tue, 25 Jul 2023 10:32:14 -0500 Subject: [PATCH] Disables link scroll on variant selection --- components/grid/three-items.tsx | 2 +- components/product/variant-selector.tsx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/components/grid/three-items.tsx b/components/grid/three-items.tsx index 3afc98707..29bc3b273 100644 --- a/components/grid/three-items.tsx +++ b/components/grid/three-items.tsx @@ -38,7 +38,7 @@ export async function ThreeItemGrid() { const [firstProduct, secondProduct, thirdProduct] = homepageItems; return ( -
+
diff --git a/components/product/variant-selector.tsx b/components/product/variant-selector.tsx index 3b2e8ac36..680d6d0c3 100644 --- a/components/product/variant-selector.tsx +++ b/components/product/variant-selector.tsx @@ -107,11 +107,14 @@ export function VariantSelector({ )?.availableForSale; const DynamicTag = isAvailableForSale ? Link : 'p'; + const dynamicProps = { + ...(isAvailableForSale && { href: optionUrl, scroll: false }) + }; return ( {value}