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

I think Line/Bar.prototype.onHoverOut is incorrect #236

Closed
denhartog opened this issue May 8, 2013 · 3 comments
Closed

I think Line/Bar.prototype.onHoverOut is incorrect #236

denhartog opened this issue May 8, 2013 · 3 comments

Comments

@denhartog
Copy link

When using option "hideHover: true/'auto', the legend is still displayed after my mouse leaves the the chart area.

Line/Bar.prototype.onHoverOut is currently:
=== 'auto'
and should be
!== false

@oesmith
Copy link
Contributor

oesmith commented May 9, 2013

When hideHover is true, the legend should not be displayed at all, hence there's no need to hide it.

If the legend is on-screen at all when hideHover == true, then we have a different problem...

@denhartog
Copy link
Author

Not according to: http://www.oesmith.co.uk/morris.js/lines.html

hideHover: true/'auto' shows the legend when hovering over it; hideHover: 'always' NEVER displays the legend

Which, except for the error I identified, is how the hideHover command works.

And while we are on the topic, it makes more sense to me to have the options for 'hideHover' be:
false = ALWAYS show;
true = NEVER show;
'auto' = show/hide on mouse in/out

All this being said, I really like Morris and am excited to contribute to this project further.

@oesmith
Copy link
Contributor

oesmith commented May 12, 2013

The false, true/'auto' and 'always' options are a concession to backwards-compatibility, hence why they're a bit odd.

You're correct that the behaviour doesn't match the docs, though. I've left a comment on the pull request. If you can fix that, I'll get it merged ASAP.

Thanks for the contribution 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants