Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cart Open iFrame -Stop Parent Page From Scrolling #841

Open
schuerwm opened this issue Apr 1, 2023 · 0 comments
Open

Cart Open iFrame -Stop Parent Page From Scrolling #841

schuerwm opened this issue Apr 1, 2023 · 0 comments

Comments

@schuerwm
Copy link

schuerwm commented Apr 1, 2023

Is there a way I can prevent the parent (main html) from scrolling when the buy button cart drawer is open on the right (shopify-buy-frame) I am using iFrame = true. When the cart is open, I can continue to scroll up and down the parent page (in background) with the cart open on the right.

Because of this on iOS, the url bar at the bottom will disappear during scroll causing the cart to redraw. The only thing I could think of is adding a class the main body overflow to hidden. I don't think this is the most elegant version so open to other ideas so you can't scroll the main page when cart drawer is open.

I tried using this code, but it doesn't work. In looking at the documentation it might need a selector but not sure I understand completely. I need something that will fire every time the shopify-buy-frame is visible and then not visable.

options: { toggle: { DOMEvents: { 'click': function (evt, target) { //set body overflow to hidden via toggleclass event. } } } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant