Skip to main content

Unable to Scroll the Store Page When Upcart Closes

This article outlines how to fix store page scrolling issues that occur after closing Upcart.

Updated over 3 weeks ago

Overview

If your store page becomes unscrollable after closing Upcart, it is likely caused by your theme’s logic that locks the page scroll when a cart drawer is open. When Upcart replaces your theme’s native cart drawer, the scroll lock may not reset properly after the drawer closes.

You can fix this by adding a small customization to remove the scroll lock behavior.


How to Fix It

Follow these steps to apply a customization that restores page scrolling after the cart closes.


Accessing Custom HTML Settings

  1. Open the Upcart App from your Shopify dashboard.

  2. Navigate to the Cart Editor.

  3. Click Settings and scroll to the bottom until you find Custom HTML.


Adding the Code

  1. Choose where to apply the HTML code in Upcart. For this fix, select the section Above Announcements/Rewards.

  2. Add the following code snippet:

<script>
window.upcartOnCartOpened = () => {
var elementLockingThePage = document.querySelector('body');
if (elementLockingThePage != null) {
elementLockingThePage.setAttribute('style', 'overflow-Y:hidden !important');
}
}
window.upcartOnCartClosed = () => {
var elementLockingThePage = document.querySelector('body');
if (elementLockingThePage != null) {
elementLockingThePage.setAttribute('style', 'overflow-Y:scroll !important');
}
}
</script>
  1. Save your changes.

  2. Refresh your storefront and test closing the cart to confirm scrolling is restored.


Why This Happens

When Upcart opens, it hides your store’s native cart drawer and takes over its visual space. However, some themes include code that locks page scrolling whenever a drawer is active. After Upcart closes, that lock may remain in place, preventing the page from scrolling.

The script above restores normal scroll behavior by manually resetting the page’s overflow property when the cart is opened or closed.


Need Help or Further Troubleshooting

If you are still experiencing scrolling issues after applying the fix, your theme may use a different selector or custom scroll logic.

Contact Upcart Support for assistance identifying the correct selector, or reach out to your theme developer for help adjusting your theme’s scroll settings.

Did this answer your question?