Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Jan 22, 2019
1 parent 057030b commit a8ded8f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
4 changes: 1 addition & 3 deletions packages/material-ui/src/Dialog/Dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,7 @@ class Dialog extends React.Component {
>
<div
className={classNames(
{
'mui-fixed': !fullScreen,
},
'mui-fixed',
classes.container,
classes[`scroll${capitalize(scroll)}`],
)}
Expand Down
15 changes: 4 additions & 11 deletions packages/material-ui/src/Modal/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Modal extends React.Component {
this.mounted = false;

if (this.props.open || (getHasTransition(this.props) && !this.state.exited)) {
this.handleClose('unmount');
this.handleClose();
}
}

Expand Down Expand Up @@ -139,14 +139,8 @@ class Modal extends React.Component {
this.modalRef.scrollTop = 0;
};

handleClose = reason => {
const hasTransition = getHasTransition(this.props);
/* If the component does not have a transition or is unmounting remove the Modal
otherwise let the transition handle removing the style, this prevents elements
moving around when the Modal is closed. */
if (!hasTransition || reason === 'unmount') {
this.props.manager.remove(this);
}
handleClose = () => {
this.props.manager.remove(this);

const doc = ownerDocument(this.mountNode);
doc.removeEventListener('focus', this.enforceFocus, true);
Expand All @@ -155,7 +149,6 @@ class Modal extends React.Component {
};

handleExited = () => {
this.props.manager.remove(this);
this.setState({ exited: true });
};

Expand Down Expand Up @@ -333,7 +326,7 @@ class Modal extends React.Component {
ref={this.handleModalRef}
onKeyDown={this.handleKeyDown}
role="presentation"
className={classNames(classes.root, className, {
className={classNames('mui-fixed', classes.root, className, {
[classes.hidden]: exited,
})}
{...other}
Expand Down

0 comments on commit a8ded8f

Please sign in to comment.