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

Comments

Projects
None yet
4 participants
@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

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.

@pawelfus pawelfus added the Bug label Dec 8, 2016

@sebastianbochan

This comment has been minimized.

Show comment
Hide comment
@sebastianbochan

sebastianbochan Dec 8, 2016

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);
}
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Dec 9, 2016

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.
Collaborator

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.
@Izothep

This comment has been minimized.

Show comment
Hide comment
@Izothep

Izothep 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.

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