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

Handle scrollbar compensation #16

Open
srph opened this issue Aug 28, 2016 · 2 comments
Open

Handle scrollbar compensation #16

srph opened this issue Aug 28, 2016 · 2 comments

Comments

@srph
Copy link

srph commented Aug 28, 2016

Usually, you would set overflow: hidden to body when the modal mounts. However, this causes a weird adjustment to the layout (because the scrollbar disappears). This mostly affects Windows/Linux users, and some OSX users that use a mouse (because it forces the scrollbar to appear).

As an example, compare Semantic UI's Modal and TWBS' Modal. TWBS solved this by adding a padding-right to the body when the modal mounts.

* I'm not sure whether this would make this project more opinionated. Moreover, I'm torn whether this belongs to the core functionality or to userland code.

@bkniffler
Copy link

Valid request, for now I'm using this (since react-modal2 sets aria-hidden attrib on app container)

[aria-hidden] {
  overflow: hidden;
}

@srph
Copy link
Author

srph commented Apr 10, 2017

Just a little update: I wrote a library months ago, might be useful for this case.

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

2 participants