Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1361 from teamleadercrm/dialog-base/portal-on-body
Browse files Browse the repository at this point in the history
Dialog: remove redundant wrapper in dialog rendering implementation
  • Loading branch information
ArnaudWeyts committed Dec 8, 2020
2 parents 0d2029d + 8b67846 commit 047c6d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Changed

- `DialogBase`: Removed redundant wrapper in dialog rendering implementation ([@ArnaudWeyts](https://github.com/ArnaudWeyts) in [#1361])

### Deprecated

### Removed
Expand Down
12 changes: 1 addition & 11 deletions src/components/dialog/DialogBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@ import theme from './theme.css';
import uiUtilities from '@teamleader/ui-utilities';

class DialogBase extends PureComponent {
dialogRoot = document.createElement('div');

componentDidMount() {
document.body.appendChild(this.dialogRoot);
}

componentWillUnmount() {
document.body.removeChild(this.dialogRoot);
}

render() {
const {
active,
Expand Down Expand Up @@ -80,7 +70,7 @@ class DialogBase extends PureComponent {
</Transition>
);

return createPortal(dialog, this.dialogRoot);
return createPortal(dialog, document.body);
}
}

Expand Down

0 comments on commit 047c6d7

Please sign in to comment.