Skip to content

Commit

Permalink
fix tooltip rendering (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebarron authored Nov 7, 2023
1 parent e0f4cc3 commit c6dd1ad
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/tooltip/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@ function toHtmlTable(featureProperties: Record<string, any>): 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;
}

Expand Down

0 comments on commit c6dd1ad

Please sign in to comment.