File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
packages/@react-aria/interactions/src Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ function setGlobalIgnoreEmulatedMouseEvents() {
48
48
} , 50 ) ;
49
49
}
50
50
51
- function handleGlobalPointerEvent ( e ) {
51
+ function handleGlobalPointerEvent ( e : PointerEvent ) {
52
52
if ( e . pointerType === 'touch' ) {
53
53
setGlobalIgnoreEmulatedMouseEvents ( ) ;
54
54
}
@@ -59,10 +59,12 @@ function setupGlobalTouchEvents() {
59
59
return ;
60
60
}
61
61
62
- if ( typeof PointerEvent !== 'undefined' ) {
63
- document . addEventListener ( 'pointerup' , handleGlobalPointerEvent ) ;
64
- } else if ( process . env . NODE_ENV === 'test' ) {
65
- document . addEventListener ( 'touchend' , setGlobalIgnoreEmulatedMouseEvents ) ;
62
+ if ( hoverCount === 0 ) {
63
+ if ( typeof PointerEvent !== 'undefined' ) {
64
+ document . addEventListener ( 'pointerup' , handleGlobalPointerEvent ) ;
65
+ } else if ( process . env . NODE_ENV === 'test' ) {
66
+ document . addEventListener ( 'touchend' , setGlobalIgnoreEmulatedMouseEvents ) ;
67
+ }
66
68
}
67
69
68
70
hoverCount ++ ;
You can’t perform that action at this time.
0 commit comments