Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
fix: tooltip closed on scroll + measure label
Browse files Browse the repository at this point in the history
  • Loading branch information
eliseeborn committed Feb 18, 2020
1 parent 4366b0c commit a0e298b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/tree/box.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default function box(
if (allowTooltips && tooltipOpen === -1 && event.buttons === 0) {
tooltipOpen = setTimeout(() => {
tooltip
.html(`${d.data.attributes.label || d.data.id}<br />${d.data.attributes.subLabel ? `${d.data.attributes.subLabel}<br />` : ''}${d.data.attributes.extraLabel ? `${d.data.attributes.extraLabel}<br />` : ''}${d.data.measure || ''}`)
.html(`${d.data.attributes.label || d.data.id}<br />${d.data.attributes.subLabel ? `${d.data.attributes.subLabel}<br />` : ''}${d.data.attributes.extraLabel ? `${d.data.attributes.extraLabel}<br />` : ''}${d.data.measure ? `${cardStyling.measureLabel ? `${cardStyling.measureLabel}: ` : ''}${d.data.measure}` : ''}`)
.attr('style', () => getTooltipStyle(d));
tooltipOpen = -1;
}, 250);
Expand All @@ -139,6 +139,14 @@ export default function box(
tooltip
.html('')
.attr('style', 'visibility: hidden;opacity: 0;');
})
.on('wheel', () => {
clearTimeout(tooltipOpen);
tooltipOpen = -1;
clearTimeout(tooltipClose);
tooltip
.html('')
.attr('style', 'visibility: hidden;opacity: 0;');
});

// expand/collapse
Expand Down

0 comments on commit a0e298b

Please sign in to comment.