Skip to content
Snippets Groups Projects
Unverified Commit d4bb3c4a authored by Dalton's avatar Dalton Committed by GitHub
Browse files

Make 'esc' button work with full page modal (#14882)

* Make 'esc' button work with full page modal

* Rmv explicit bind
parent 0b1c1562
Branches
Tags
No related merge requests found
......@@ -56,11 +56,11 @@ export class WindowModal extends Component {
}
}
handleDismissal() {
handleDismissal = () => {
if (this.props.onClose) {
this.props.onClose();
}
}
};
_modalComponent() {
const className = cx(
......@@ -70,7 +70,7 @@ export class WindowModal extends Component {
.map(type => `Modal--${type}`),
);
return (
<OnClickOutsideWrapper handleDismissal={this.handleDismissal.bind(this)}>
<OnClickOutsideWrapper handleDismissal={this.handleDismissal}>
<div className={cx(className, "relative bg-white rounded")}>
{getModalContent({
...this.props,
......@@ -160,6 +160,12 @@ export class FullPageModal extends Component {
}, 300);
}
handleDismissal = () => {
if (this.props.onClose) {
this.props.onClose();
}
};
_renderModal(open) {
ReactDOM.unstable_renderSubtreeIntoContainer(
this,
......@@ -177,7 +183,7 @@ export class FullPageModal extends Component {
occupies the entire screen. We do this to put this modal on top of
the OnClickOutsideWrapper popover stack. Otherwise, clicks within
this modal might be seen as clicks outside another popover. */}
<OnClickOutsideWrapper>
<OnClickOutsideWrapper handleDismissal={this.handleDismissal}>
<div
className="full-height relative scroll-y"
style={motionStyle}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment