Solving the Shopify Product Page Scroll Lock: A Klaviyo Form Deep Dive

Hey fellow store owners! Have you ever hit a snag with your Shopify store where something just isn't behaving as expected, and you're left scratching your head? We've all been there. Recently, I was following a really interesting discussion in the Shopify community that highlighted a common, yet tricky, issue: a product page refusing to scroll. This isn't just an annoyance; it's a critical conversion killer! Let's dive into what happened and, more importantly, how to fix it.

The Mystery of the Stuck Product Page

The thread kicked off with @siva_fds, who was facing an urgent problem with their store, Cordori.com.au. Specifically, their 'Cloudigan' product page, running on the Reformation theme, simply wouldn't scroll on either desktop or mobile. Imagine a customer landing on your beautiful product page, ready to explore, only to find themselves stuck at the top! Talk about frustrating.

Here's a look at the product that was causing all the fuss:

The Community's Detective Work: Pinpointing the Culprit

Thankfully, the Shopify community is full of sharp minds, and @vestfoldhall quickly jumped in with some brilliant detective work. After loading the page and meticulously observing its behavior, they discovered something fascinating. The page would scroll for about five seconds. But then, between five and ten seconds, the element would mysteriously pick up a CSS class: klaviyo-prevent-body-scrolling. This class, as its name suggests, sets the overflow property to hidden, effectively locking the page!

The real kicker? This class is added by Klaviyo's onsite script, typically when one of your sign-up forms wants to lock the page behind it (like a full-screen popup). However, in this case, the form itself never appeared! So, the page was locked indefinitely, with no way for a shopper to interact further.

This insight was crucial because it immediately ruled out the theme itself as the cause. As @vestfoldhall noted, "Reformation 9.0.0 renders the page correctly; the lock arrives from the Klaviyo script after load." This is a classic example of an app or script interfering with core theme functionality.

How to Fix It: Two Paths to a Scrolling Page

Based on the community discussion, there are two main ways to tackle this issue. One is the ideal, long-term solution that addresses the root cause, and the other is a quick patch to get you by.

Path 1: The Best Fix – Adjusting Your Klaviyo Forms (Recommended!)

This is the approach @vestfoldhall strongly recommended because it fixes the underlying problem without breaking other intended functionality. Here's how to do it:

  1. Log into your Klaviyo account.
  2. Navigate to 'Sign-up forms'.
  3. Identify the culprit form: Look for any form that targets product pages (or all pages) and is set to full screen or configured to lock scrolling. Pay close attention to its display settings and device targeting. Sometimes, a form meant for mobile might misfire on desktop, or vice-versa.
  4. Test for the issue: Unpublish the suspicious form.
  5. Reload your product page: Open your Shopify product page (e.g., the 'Cloudigan' page) in a private or incognito browser window to ensure no caching interferes.
  6. Confirm the fix: Check if the page now scrolls freely after the initial 10-second window.
  7. Repeat if necessary: If you have multiple forms, republish them one at a time and re-test until you find the specific form causing the problem. Once identified, you can either adjust its settings to prevent scroll locking or ensure it displays correctly if it's meant to be a popup.

Path 2: The Quick Patch – Adding Custom CSS (Use with Caution)

While fixing the Klaviyo form directly is the best long-term solution, sometimes you need a quick fix, especially if you're in a hurry or need more time to debug Klaviyo. @Mustafa_Ali provided a simple CSS snippet that can override the scroll-locking behavior. However, @vestfoldhall correctly pointed out that this patch stops the symptom but also removes the scroll lock Klaviyo relies on when a real popup is open. This means a shopper could scroll the page behind a form, which might not be your intended user experience.

If you choose this path as a temporary measure, here's how to implement it:

  1. Go to your Shopify Admin: From your dashboard, navigate to 'Online Store' > 'Themes'.
  2. Edit your theme code: Find your current theme, click the 'Actions' (three dots) button, and select 'Edit code'.
  3. Find theme.liquid: In the file explorer on the left, locate the theme.liquid file under the 'Layout' section.
  4. Insert the code: Paste the following code snippet just before the closing tag.

Here's a visual guide from @Mustafa_Ali showing where to place the code:

  1. Save your changes.

Key Takeaways for Your Store

This community discussion is a fantastic reminder of a few things:

  • App Conflicts are Real: Sometimes, issues aren't with your theme directly but with how third-party apps interact with it. Always consider recent app installations or updates if something suddenly breaks.
  • Diagnose the Root Cause: While quick fixes are tempting, understanding why something is happening (like @vestfoldhall did with Klaviyo) leads to more robust and lasting solutions.
  • The Community is Your Friend: Don't hesitate to reach out to the Shopify community. There's a wealth of knowledge and helpful experts ready to assist!

If you're running into similar issues, or thinking about setting up your own online store, remember that starting a Shopify store provides a powerful, flexible platform, but managing your apps and integrations carefully is key to a smooth customer experience. Always test changes thoroughly in a development theme or private browser window before pushing them live.

Hopefully, this deep dive into a common product page problem helps you keep your store running smoothly and your customers scrolling happily!

Share:

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools