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

When modal is open, turn off body scrolling #3453

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jrochkind
Copy link
Member

These inline styles are what bootstrap 4 does, discovered through reverse-engineering, although it uses a lot more abstraction to do it. (A ScrollHelper object that can do a lot more things).

This behavior now matches Bootstrap modal behavior, and avoids some weird double scroll within scroll.

Before

Screen.Recording.2024-11-21.at.2.55.47.PM.mov

After

Screen.Recording.2024-11-21.at.2.56.58.PM.mov
  • Only one visible scrollbar
  • It does not scroll the body behind the modal, it only scrolls enough to see modal
  • This matches bootstrap modal behavior

These inline styles are what bootstrap 4 does, discovered through reverse-engineering, although it uses a lot more abstraction to do it. (A ScrollHelper object that can do a lot more things).

This behavior now matches Bootstrap modal behavior, and avoids some weird double scroll within scroll.
@jrochkind
Copy link
Member Author

jrochkind commented Nov 25, 2024

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

Successfully merging this pull request may close these issues.

1 participant