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. Additionally, Upcart now provides built-in settings to address these issues, such as overriding existing scroll locking logic.
You can fix this by using built-in settings within Upcart or by adding a small customization to remove the scroll lock behavior.
How to Fix It
Using Built-In Solutions
For most cases, built-in options in Upcart settings can resolve scrolling issues without requiring custom code.
Enable "Override Existing Scroll Locking Logic":
Open the Cart Editor in your Upcart settings.
Navigate to Settings → Advanced Settings.
Enable the option labeled "Override existing scroll locking logic."
Enable Advanced Setting for Mobile Scrolling Issues (if needed):
In the Cart Editor, go to Settings → Advanced Settings.
Look for the setting related to resolving mobile or overlay issues and enable it.
Follow these steps to apply a customization that restores page scrolling after the cart closes.
Accessing Custom HTML Settings
Open the Upcart App from your Shopify dashboard.
Navigate to the Cart Editor.
Click Settings and scroll to the bottom until you find Custom HTML.
Adding the Code
For advanced or specific cases where built-in solutions do not resolve the issue, you can apply custom HTML code in Upcart. Choose where to apply the HTML code in Upcart. For this fix, select the section Above Announcements/Rewards.
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>
Save your changes.
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. On mobile devices, additional issues such as overlays persisting or causing the page to become unclickable can occur. These problems are often tied to mobile-specific scroll locking behaviors or unreset overlays.
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
Additional Steps Before Contacting Support
Ensure both "Override Existing Scroll Locking Logic" and advanced scroll settings for mobile are enabled.
Double-check if custom code or third-party scripts might interfere.
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.