Skip to content

Commit

Permalink
Prevent scroll reset on variant change (#2672)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottdixon authored Dec 12, 2024
1 parent 73c3fcf commit e6654f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/loud-bags-cross.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@shopify/create-hydrogen': patch
'skeleton': patch
---

Prevent scroll reset on variant change
3 changes: 2 additions & 1 deletion templates/skeleton/app/components/ProductForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export function ProductForm({
if (!selected) {
navigate(`?${variantUriQuery}`, {
replace: true,
preventScrollReset: true,
});
}
}}
Expand All @@ -98,7 +99,7 @@ export function ProductForm({
</div>
<br />
</div>
)
);
})}
<AddToCartButton
disabled={!selectedVariant || !selectedVariant.availableForSale}
Expand Down

0 comments on commit e6654f0

Please sign in to comment.