@@ -59,9 +59,9 @@ export function useInteractOutside(props: InteractOutsideProps) {
59
59
if ( typeof PointerEvent !== 'undefined' ) {
60
60
let onPointerUp = ( e ) => {
61
61
if ( state . isPointerDown && state . onInteractOutside && isValidEvent ( e , ref ) ) {
62
- state . isPointerDown = false ;
63
62
state . onInteractOutside ( e ) ;
64
63
}
64
+ state . isPointerDown = false ;
65
65
} ;
66
66
67
67
// changing these to capture phase fixed combobox
@@ -77,17 +77,17 @@ export function useInteractOutside(props: InteractOutsideProps) {
77
77
if ( state . ignoreEmulatedMouseEvents ) {
78
78
state . ignoreEmulatedMouseEvents = false ;
79
79
} else if ( state . isPointerDown && state . onInteractOutside && isValidEvent ( e , ref ) ) {
80
- state . isPointerDown = false ;
81
80
state . onInteractOutside ( e ) ;
82
81
}
82
+ state . isPointerDown = false ;
83
83
} ;
84
84
85
85
let onTouchEnd = ( e ) => {
86
86
state . ignoreEmulatedMouseEvents = true ;
87
87
if ( state . onInteractOutside && state . isPointerDown && isValidEvent ( e , ref ) ) {
88
- state . isPointerDown = false ;
89
88
state . onInteractOutside ( e ) ;
90
89
}
90
+ state . isPointerDown = false ;
91
91
} ;
92
92
93
93
document . addEventListener ( 'mousedown' , onPointerDown , true ) ;
0 commit comments