From 29aaa8cac67ca51e5ac6e33721eda611c4c45c31 Mon Sep 17 00:00:00 2001 From: Michael Novotny Date: Tue, 25 Jul 2023 11:00:31 -0500 Subject: [PATCH] Disables link scroll on variant selection (#1109) * Disables link scroll on variant selection * Fix TS error --- components/grid/three-items.tsx | 2 +- components/product/variant-selector.tsx | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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..188a5b406 100644 --- a/components/product/variant-selector.tsx +++ b/components/product/variant-selector.tsx @@ -107,10 +107,14 @@ export function VariantSelector({ )?.availableForSale; const DynamicTag = isAvailableForSale ? Link : 'p'; + const dynamicProps = { + ...(isAvailableForSale && { scroll: false }) + }; return ( {value}