@@ -371,13 +371,13 @@ export const createHoverifier = ({
371
371
const hoverObservables = resolvedPositions . pipe (
372
372
map ( ( { position, ...rest } ) => {
373
373
if ( ! position ) {
374
- return of ( { ...rest , hoverOrError : undefined , part : undefined } )
374
+ return of ( { ...rest , hoverOrError : null , part : undefined } )
375
375
}
376
376
// Fetch the hover for that position
377
377
const hoverFetch = fetchHover ( position ) . pipe (
378
378
catchError ( error => {
379
379
if ( error && error . code === EMODENOTFOUND ) {
380
- return [ undefined ]
380
+ return [ null ]
381
381
}
382
382
return [ asError ( error ) ]
383
383
} ) ,
@@ -444,7 +444,7 @@ export const createHoverifier = ({
444
444
// Fetch the definition location for that position
445
445
map ( ( { position } ) => {
446
446
if ( ! position ) {
447
- return of ( undefined )
447
+ return of ( null )
448
448
}
449
449
return concat (
450
450
[ LOADING ] ,
@@ -497,8 +497,13 @@ export const createHoverifier = ({
497
497
// and can reevaluate our pinning decision whenever one of the two updates,
498
498
// independent of the order in which they emit
499
499
return combineLatest ( hoverObservable , definitionObservable ) . pipe (
500
- map ( ( [ { hoverOrError } , definitionURLOrError ] ) =>
501
- overlayUIHasContent ( { hoverOrError, definitionURLOrError } )
500
+ map (
501
+ ( [ { hoverOrError } , definitionURLOrError ] ) =>
502
+ // In the time between the click/jump and the loader being displayed,
503
+ // pin the hover overlay so mouseover events get ignored
504
+ // If the hover comes back empty (and the definition) it will get unpinned again
505
+ hoverOrError === undefined ||
506
+ overlayUIHasContent ( { hoverOrError, definitionURLOrError } )
502
507
)
503
508
)
504
509
} )
0 commit comments