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

flux:modal: Hide body scrollbar when modal is opened #680

Open
BubeDameKoenig opened this issue Nov 14, 2024 · 0 comments
Open

flux:modal: Hide body scrollbar when modal is opened #680

BubeDameKoenig opened this issue Nov 14, 2024 · 0 comments

Comments

@BubeDameKoenig
Copy link

If you open a flux:modal and the page has a scrollbar, this leads to strange user handling.
It becomes very strange if it is a flyout and it is longer. So there are two scrollbars next to each other.

Here in Github the body scrollbar is hidden.

Alpine suggestion:

x-init="$watch('show', value => {
      if (value) {
          document.body.classList.add('overflow-y-hidden');
      } else {
          document.body.classList.remove('overflow-y-hidden');
      }
  })"

Image

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