mirror of
https://github.com/apache/superset.git
synced 2024-09-17 11:09:47 -04:00
Fixing issue where tooltip gets hidden on dashboard for all charts (#6852)
This commit is contained in:
parent
73e119a84e
commit
4638618545
@ -712,7 +712,7 @@ function nvd3Vis(element, props) {
|
||||
.call(chart);
|
||||
|
||||
// on scroll, hide tooltips. throttle to only 4x/second.
|
||||
window.addEventListener('scroll', throttle(hideTooltips, 250));
|
||||
window.addEventListener('scroll', throttle(() => hideTooltips(element), 250));
|
||||
|
||||
// The below code should be run AFTER rendering because chart is updated in call()
|
||||
if (isTimeSeries && activeAnnotationLayers.length > 0) {
|
||||
@ -936,7 +936,7 @@ function nvd3Vis(element, props) {
|
||||
// hide tooltips before rendering chart, if the chart is being re-rendered sometimes
|
||||
// there are left over tooltips in the dom,
|
||||
// this will clear them before rendering the chart again.
|
||||
hideTooltips();
|
||||
hideTooltips(element);
|
||||
|
||||
nv.addGraph(drawGraph);
|
||||
}
|
||||
|
@ -165,12 +165,14 @@ export function generateBubbleTooltipContent({
|
||||
return s;
|
||||
}
|
||||
|
||||
export function hideTooltips() {
|
||||
const targets = document.querySelectorAll('.nvtooltip');
|
||||
export function hideTooltips(element) {
|
||||
if (element) {
|
||||
const targets = element.querySelectorAll('.nvtooltip');
|
||||
if (targets.length > 0) {
|
||||
targets.forEach(t => t.remove());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function wrapTooltip(chart, maxWidth) {
|
||||
const tooltipLayer = chart.useInteractiveGuideline && chart.useInteractiveGuideline() ?
|
||||
|
Loading…
Reference in New Issue
Block a user