File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 124
124
var bcr = t . getBoundingClientRect ( ) ;
125
125
// use page x/y to account for scrolling
126
126
var x = ev . pageX , y = ev . pageY ;
127
- return ( x >= bcr . left && x <= bcr . right ) &&
128
- ( y >= bcr . top && y <= bcr . bottom ) ;
127
+ // ev is a synthetic click if the position is outside the bounding box of the target
128
+ return ! ( ( x >= bcr . left && x <= bcr . right ) && ( y >= bcr . top && y <= bcr . bottom ) ) ;
129
129
}
130
130
return false ;
131
131
}
Original file line number Diff line number Diff line change 54
54
} ) ;
55
55
56
56
test ( 'HTMLElement.click triggers tap' , function ( ) {
57
+ // put the element off screen to prevent x/y weirdness from .click()
58
+ app . style . cssText = 'position: absolute; left: -1000px; top: -1000px;' ;
57
59
// make a mousedown *very* far away to tickle the distance check
58
60
var ev = new CustomEvent ( 'mousedown' ) ;
59
61
ev . clientX = 1e8 ;
You can’t perform that action at this time.
0 commit comments