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

[Modal] Improve scroll handling #8715

Merged
merged 1 commit into from
Oct 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/src/modules/components/withRoot.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ const pages = [
{
pathname: '/getting-started/supported-platforms',
},
{
pathname: '/getting-started/frequently-asked-questions',
},
],
},
{
Expand Down
14 changes: 14 additions & 0 deletions docs/src/pages/getting-started/frequently-asked-questions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Frequently asked questions

Stuck on a particular problem?
Check some of these common gotchas first.

If you still cannot find what you are looking for, you can ask the community in [gitter](https://gitter.im/callemall/material-ui).
For how-to questions and other non-issues, please use [StackOverflow](https://stackoverflow.com/questions/tagged/material-ui) instead of Github issues. There is a StackOverflow tag called `material-ui` that you can use to tag your questions.

## Fixed positioned elements move when a modal is opened

We block the scroll as soon as a modal is opened.
It prevents interacting with the background when the modal should be the only interactive content.
However, removing the scrollbar can make your **fixed positioned elements** move.
In this situation, you can apply a global `.mui-fixed` class name to tell Material-UI to handle those elements.
12 changes: 12 additions & 0 deletions pages/getting-started/frequently-asked-questions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// @flow

import React from 'react';
import withRoot from 'docs/src/modules/components/withRoot';
import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs';
import markdown from 'docs/src/pages/getting-started/frequently-asked-questions.md';

function Page() {
return <MarkdownDocs markdown={markdown} />;
}

export default withRoot(Page);
1 change: 1 addition & 0 deletions src/AppBar/AppBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const styles = (theme: Object) => ({
display: 'flex',
flexDirection: 'column',
width: '100%',
boxSizing: 'border-box', // Prevent padding issue with the Modal and fixed positioned AppBar.
zIndex: theme.zIndex.appBar,
flexShrink: 0,
},
Expand Down