@@ -153,13 +153,10 @@ export default class ModalPortal extends Component {
153
153
}
154
154
}
155
155
156
- handleOverlayMouseDown = ( ) => {
156
+ handleOverlayOnClick = ( event ) => {
157
157
if ( this . shouldClose === null ) {
158
158
this . shouldClose = true ;
159
159
}
160
- }
161
-
162
- handleOverlayMouseUp = ( event ) => {
163
160
if ( this . shouldClose && this . props . shouldCloseOnOverlayClick ) {
164
161
if ( this . ownerHandlesClose ( ) ) {
165
162
this . requestClose ( event ) ;
@@ -170,11 +167,7 @@ export default class ModalPortal extends Component {
170
167
this . shouldClose = null ;
171
168
}
172
169
173
- handleContentMouseDown = ( ) => {
174
- this . shouldClose = false ;
175
- }
176
-
177
- handleContentMouseUp = ( ) => {
170
+ handleContentOnClick = ( ) => {
178
171
this . shouldClose = false ;
179
172
}
180
173
@@ -217,17 +210,15 @@ export default class ModalPortal extends Component {
217
210
ref = { ( c ) => { this . overlay = c ; } }
218
211
className = { this . buildClassName ( 'overlay' , this . props . overlayClassName ) }
219
212
style = { Assign ( { } , overlayStyles , this . props . style . overlay || { } ) }
220
- onMouseDown = { this . handleOverlayMouseDown }
221
- onMouseUp = { this . handleOverlayMouseUp }
213
+ onClick = { this . handleOverlayOnClick }
222
214
>
223
215
< div
224
216
ref = { ( c ) => { this . content = c ; } }
225
217
style = { Assign ( { } , contentStyles , this . props . style . content || { } ) }
226
218
className = { this . buildClassName ( 'content' , this . props . className ) }
227
219
tabIndex = { - 1 }
228
220
onKeyDown = { this . handleKeyDown }
229
- onMouseDown = { this . handleContentMouseDown }
230
- onMouseUp = { this . handleContentMouseUp }
221
+ onClick = { this . handleContentOnClick }
231
222
role = { this . props . role }
232
223
aria-label = { this . props . contentLabel }
233
224
>
0 commit comments