From 7257661db5fc70a5ec9f3d9e291ffe46eb7b4c02 Mon Sep 17 00:00:00 2001 From: Kyle Barron Date: Mon, 6 Nov 2023 20:35:15 -0500 Subject: [PATCH] fix tooltip rendering --- src/tooltip/index.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/tooltip/index.ts b/src/tooltip/index.ts index baeb1843..fae099e4 100644 --- a/src/tooltip/index.ts +++ b/src/tooltip/index.ts @@ -23,11 +23,17 @@ function toHtmlTable(featureProperties: Record): string { export function getTooltip({ object }: GeoArrowPickingInfo): TooltipContent { if (object) { - // If the row index is -1, return + // If the row index is -1 or undefined, return // // Note that this is a private API, but this appears to be the only way to // get this information - if (object[rowIndexSymbol] && object[rowIndexSymbol] < 0) { + // + // Without this block, we end up showing a tooltip even when not hovering + // over a point + if ( + !object[rowIndexSymbol] || + (object[rowIndexSymbol] && object[rowIndexSymbol] < 0) + ) { return null; }