Skip to content
This repository has been archived by the owner on Feb 18, 2023. It is now read-only.

Charts: click through tooltips #84

Merged
merged 1 commit into from
Mar 24, 2020
Merged

Conversation

jotak
Copy link
Collaborator

@jotak jotak commented Mar 23, 2020

When onclick handler is defined, it must catch clicks through tooltips as well. Else, tooltip would prevent user to catch what is "behind" it.

Fixes kiali/kiali#2527

Can be tested via storybook "ChartWithLegend as scatter plots", clicking on one of the plot where tooltip hides the plot:

Capture d’écran de 2020-03-23 10-29-12

When onclick handler is defined, it must catch clicks through tooltips as well. Else, tooltip would prevent user to catch what is "behind" it.

Fixes kiali/kiali#2527
Copy link
Member

@israel-hdez israel-hdez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if really important, but I see that if you click on the square that it's inside the tooltip, it won't trigger the event. Probably it would be tooooo much luck if that little square gets aligned with the chart's point and fall behind the mouse cursor to "block" the click. It's such a small area that it's probably like the change of a planetary alignment.

So... LGTM :D

if (closest) {
this.props.onClick!(closest);
}
onClick!(event);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpicking... You probably don't need the bang.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's needed because we're in a lambda

@jotak
Copy link
Collaborator Author

jotak commented Mar 24, 2020

Not sure if really important, but I see that if you click on the square that it's inside the tooltip, it won't trigger the event. Probably it would be tooooo much luck if that little square gets aligned with the chart's point and fall behind the mouse cursor to "block" the click. It's such a small area that it's probably like the change of a planetary alignment.

So... LGTM :D

Lol you're right :) . I believe it's so unlikely to happen (and so easily workable around, as clicking next to the square would still find closest point) that we can live without a fix for that

Thanks for the review!

@jotak jotak merged commit 9509ff5 into kiali:master Mar 24, 2020
@jotak jotak deleted the click-through-tooltip branch March 24, 2020 09:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tooltip covers up bubble in trace window so that you can't click it
2 participants