Skip to content

Commit fe1983b

Browse files
tsmirnovdiasbruno
authored andcommitted
fix #466: Dragging inside modal and release outside of modal closes the modal
1 parent 825fd00 commit fe1983b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: src/components/ModalPortal.js

+5
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ export default class ModalPortal extends Component {
221221
this.shouldClose = false;
222222
}
223223

224+
handleCountenOnMouseDown = () => {
225+
this.shouldClose = false;
226+
}
227+
224228
requestClose = event =>
225229
this.ownerHandlesClose() && this.props.onRequestClose(event);
226230

@@ -273,6 +277,7 @@ export default class ModalPortal extends Component {
273277
className={this.buildClassName('content', className)}
274278
tabIndex="-1"
275279
onKeyDown={this.handleKeyDown}
280+
onMouseDown={this.handleCountenOnMouseDown}
276281
onClick={this.handleContentOnClick}
277282
role={this.props.role}
278283
aria-label={this.props.contentLabel}

0 commit comments

Comments
 (0)