File tree 2 files changed +10
-1
lines changed
static/app/components/checkInTimeline
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,10 @@ function TestComponent() {
24
24
}
25
25
26
26
describe ( 'TimelineCursor' , function ( ) {
27
+ beforeEach ( ( ) => {
28
+ document . elementsFromPoint = ( ) => [ ] ;
29
+ } ) ;
30
+
27
31
it ( 'renders' , async function ( ) {
28
32
render ( < TestComponent /> ) ;
29
33
Original file line number Diff line number Diff line change @@ -65,11 +65,16 @@ function useTimelineCursor<E extends HTMLElement>({
65
65
// within the containerRect. This proves to be less glitchy as some
66
66
// elements within the container may trigger an onMouseLeave even when
67
67
// the mouse is still "inside" of the container
68
+ //
69
+ // Also tests that the mouse is not obscured by a overlay element.
68
70
const isInsideContainer =
69
71
e . clientX > containerRect . left &&
70
72
e . clientX < containerRect . right &&
71
73
e . clientY > containerRect . top &&
72
- e . clientY < containerRect . bottom ;
74
+ e . clientY < containerRect . bottom &&
75
+ ! document
76
+ . elementsFromPoint ( e . clientX , e . clientY )
77
+ . some ( el => el . hasAttribute ( 'data-overlay' ) ) ;
73
78
74
79
if ( isInsideContainer !== isVisible ) {
75
80
setIsVisible ( isInsideContainer ) ;
You can’t perform that action at this time.
0 commit comments