Skip to content

Commit

Permalink
fix reactjs#466: Dragging inside modal and release outside of modal c…
Browse files Browse the repository at this point in the history
…loses the modal
  • Loading branch information
tsmirnov authored and diasbruno committed Aug 14, 2017
1 parent 825fd00 commit fe1983b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/ModalPortal.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ export default class ModalPortal extends Component {
this.shouldClose = false;
}

handleCountenOnMouseDown = () => {
this.shouldClose = false;
}

requestClose = event =>
this.ownerHandlesClose() && this.props.onRequestClose(event);

Expand Down Expand Up @@ -273,6 +277,7 @@ export default class ModalPortal extends Component {
className={this.buildClassName('content', className)}
tabIndex="-1"
onKeyDown={this.handleKeyDown}
onMouseDown={this.handleCountenOnMouseDown}
onClick={this.handleContentOnClick}
role={this.props.role}
aria-label={this.props.contentLabel}
Expand Down

0 comments on commit fe1983b

Please sign in to comment.