Browser : Chrome 110
OS : macOS / Windows / Linux / etc.
URL : Link to a page that illustrates this issue
Video : Short screen recording that illustrates this issue (free tool: jam.dev )
Could the team please look at this issue - SOLVED: Mini cart closes on scroll when header is set on Slide up on scroll ?
timmse
August 26, 2024, 10:17am
2
Hi,
The issue should already be fixed in Bricks 1.10: Bricks 1.10 Changelog – Bricks
Please test it again using the latest version. We’re currently working on a similar issue with the mini cart offcanvas, which should be solved soon, too.
Best regards,
timmse
timmse:
s
I am on the latest version now - it got a little bit better, however, when the scroll bar within the mini cart is present, and when you continue to scroll after reaching the end of the mini cart scroll bar, you can see that the main page scroll bar can be scrolled.
timmse
August 26, 2024, 1:01pm
4
True, but that’s not a bug; it’s a feature request since there is currently no “disable body scroll” setting.
You can implement it yourself using this custom JS, if needed:
Use this in a code block in your header.
document.addEventListener("DOMContentLoaded", function () {
// Add event listener to the mini cart link, if it exists
const miniCartLink = document.querySelector('.mini-cart-link');
if (miniCartLink) {
miniCartLink.addEventListener('click', function () {
document.body.classList.add('no-scroll');
});
}
// Add event listener to the bricks mini cart close button, if it exists
const miniCartClose = documen…
1 Like
Makes sense, and thank you for the update and info!
document.addEventListener("DOMContentLoaded", function () {
// Add event listener to the mini cart link, if it exists
const miniCartLink = document.querySelector('.mini-cart-link');
if (miniCartLink) {
miniCartLink.addEventListener('click', function () {
document.body.classList.add('no-scroll');
});
}
// Add event listener to the bricks mini cart close button, if it exists
const miniCartClose = document.querySelector('.bricks-mini-cart-close');
if (miniCartClose) {
miniCartClose.addEventListener('click', function () {
document.body.classList.remove('no-scroll');
});
}
// Add event listener to the off-canvas overlay inside the brxe-woocommerce-mini-cart element
const miniCartOverlay = document.querySelector('.brxe-woocommerce-mini-cart .off-canvas-overlay');
if (miniCartOverlay) {
miniCartOverlay.addEventListener('click', function () {
document.body.classList.remove('no-scroll');
});
}
});
Works for me, many thanks.