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

Closed
Izothep opened this issue Dec 7, 2016 · 3 comments
Closed

Legend items stays hovered on mouseout. #6113

Izothep opened this issue Dec 7, 2016 · 3 comments

Comments

@Izothep
Copy link
Contributor

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

http://jsfiddle.net/bpaq9zz3/4/

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

Affected browser(s)

Tested on Chrome and Safari browsers.

@sebastianbochan
Copy link
Contributor

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) {
	elemWrapper.renderer.buildText(elemWrapper);
}

@TorsteinHonsi
Copy link
Collaborator

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.

@Izothep
Copy link
Contributor Author

Izothep commented Jan 4, 2017

As a quick workaround, you can use small wrapper I made:
http://jsfiddle.net/bpaq9zz3/6/

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
Projects
None yet
Development

No branches or pull requests

4 participants