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

Legend items stays hovered on mouseout. #6113

Izothep opened this issue Dec 7, 2016 · 3 comments

Legend items stays hovered on mouseout. #6113

Izothep opened this issue Dec 7, 2016 · 3 comments


Copy link

@Izothep Izothep commented Dec 7, 2016

Expected behaviour

If series are hidden, legend items are changing color on mouseover. When the mouse is no longer hovering legend items (mouseout event) they should change color to default again.

Actual behaviour

Right now sometimes legend item stays hovered on even if mouse is not longer over this element. It looks to be connected with setting specific width of legend items.

Live demo with steps to reproduce

To reproduce this issue try to move mouse pointer fast inside legend.

Affected browser(s)

Tested on Chrome and Safari browsers.

@pawelfus pawelfus added the Type: Bug label Dec 8, 2016
Copy link

@sebastianbochan sebastianbochan commented Dec 8, 2016

Internal note
It looks like buildText in the css() function has an influence on delay. When we comment it, the text is displayed in the right width and hover state is applied properly.

if (textWidth) {
Copy link

@TorsteinHonsi TorsteinHonsi commented Dec 9, 2016

The buildText function is quite heavy and it's not necessary to call it in this case. We should probably add a caching system similar to (or the same as) the one at getBBox. The text only needs to be rebuilt when:

  • The textWidth changes.
  • The font size changes.
  • The text string itself changes.
Copy link
Contributor Author

@Izothep Izothep commented Jan 4, 2017

As a quick workaround, you can use small wrapper I made:

Unfortunately, it is just a workaround, not a full solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.