question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Back button with modal opened freeze the page scroll

See original GitHub issue

I’m submitting a…


[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request

Current behavior

When you click a back button with the modal gallery opened, the page scroll freeze. This is happening due a attribute added to the body style=“overflow: hidden;” and changing the page this is not reset.

Expected behavior

The page scroll naturally as expected.

Minimal reproduction of the problem with instructions

Using the available project demo, open a modal gallery and then click the back button of the browser.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
srtabcommented, Sep 15, 2018

Perfect, many thanks @Ks89!

1reaction
Ks89commented, Sep 13, 2018

Issue confirmed. I’ll try to fix it this weekend

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prevent Page Scrolling When a Modal is Open | CSS-Tricks
If we know the top of the scroll location and add it to our CSS, then the body will not scroll back to...
Read more >
Prevent BODY from scrolling when a modal is opened
Bootstrap's modal automatically adds the class modal-open to the body when a modal dialog is shown and removes it when the dialog is...
Read more >
How to prevent Body from scrolling when a modal is opened ...
Given an HTML document with a modal, the task is to prevent the body element from scrolling whenever the modal is in an...
Read more >
Stop the page from scrolling when a modal is open - Webflow
This is a quick guide on creating modals that stop the page from scrolling, after you've opened a modal. Closing the modal via...
Read more >
Prototype scrolling with overflow behavior - Figma Help Center
Scroll up or down on a long page of content · Scroll left-to-right to view different elements in a slider. · Navigate between...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found