Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bugfix] nvd3 tooltips do not disappear #3487

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions superset/assets/visualizations/nvd3_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,19 @@ function nvd3Vis(slice, payload) {
.call(chart);
}

// clean up tooltips when switching to another viz
const container = $(slice.selector);
if (!container.data('observed')) {
container.data('observed', true); // limit to one observer
const observer = new MutationObserver(() => {
container.data('observed', false);
$('.nvtooltip').remove();
observer.disconnect();
});
const cfg = { attributes: true, attributeFilter: ['class'] };
observer.observe(container[0], cfg);
}

// on scroll, hide tooltips. throttle to only 4x/second.
$(window).scroll(throttle(hideTooltips, 250));

Expand Down