@@ -657,6 +657,7 @@ export default class Select<
657
657
scrollToFocusedOptionOnUpdate = false ;
658
658
userIsDragging ?: boolean ;
659
659
isAppleDevice = isAppleDevice ( ) ;
660
+ mouseDownTriggeredBeyondControl = false ;
660
661
661
662
// Refs
662
663
// ------------------------------
@@ -1293,8 +1294,9 @@ export default class Select<
1293
1294
onControlMouseDown = (
1294
1295
event : React . MouseEvent < HTMLDivElement > | React . TouchEvent < HTMLDivElement >
1295
1296
) => {
1296
- // Event captured by dropdown indicator
1297
- if ( event . defaultPrevented ) {
1297
+ // Event captured somewhere deeper in the DOM
1298
+ if ( this . mouseDownTriggeredBeyondControl ) {
1299
+ this . mouseDownTriggeredBeyondControl = false ;
1298
1300
return ;
1299
1301
}
1300
1302
const { openMenuOnClick } = this . props ;
@@ -1342,6 +1344,7 @@ export default class Select<
1342
1344
} else {
1343
1345
this . openMenu ( 'first' ) ;
1344
1346
}
1347
+ this . mouseDownTriggeredBeyondControl = true ;
1345
1348
event . preventDefault ( ) ;
1346
1349
} ;
1347
1350
onClearIndicatorMouseDown = (
@@ -1356,6 +1359,7 @@ export default class Select<
1356
1359
return ;
1357
1360
}
1358
1361
this . clearValue ( ) ;
1362
+ this . mouseDownTriggeredBeyondControl = true ;
1359
1363
event . preventDefault ( ) ;
1360
1364
this . openAfterFocus = false ;
1361
1365
if ( event . type === 'touchend' ) {
@@ -1835,6 +1839,7 @@ export default class Select<
1835
1839
onClick : ( ) => this . removeValue ( opt ) ,
1836
1840
onTouchEnd : ( ) => this . removeValue ( opt ) ,
1837
1841
onMouseDown : ( e ) => {
1842
+ this . mouseDownTriggeredBeyondControl = true ;
1838
1843
e . preventDefault ( ) ;
1839
1844
} ,
1840
1845
} }
0 commit comments