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

Ensure that the timetracking tooltip is removed when the mouse leaves diagram #4219

Merged
merged 4 commits into from
Aug 7, 2019

Conversation

philippotto
Copy link
Member

@philippotto philippotto commented Aug 5, 2019

The chart library seems to be a bit buggy. In addition, to the position fix, we now have a new issue. When zooming in and out while the tooltip is visible, the tooltip won't disappear afterwards (also the content will not change anymore).

As a dirty fix, I added code to the mouse move listener which simply checks whether we are hovering a time entry element (recognizable because it's a rect with a stroke color). If not, the tooltip is removed. Not elegant, but it at least works 🙄

URL of deployed dev instance (used for testing):

Steps to test:

  • hover over time statistics and zoom in and out while the tooltip is visible
  • the tooltip should hide/appear as expected

Issues:


@philippotto philippotto requested a review from daniel-wer August 5, 2019 14:22
@philippotto philippotto self-assigned this Aug 5, 2019
Copy link
Member

@daniel-wer daniel-wer left a comment

Choose a reason for hiding this comment

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

Works well, thanks for taking the time to find a workaround for this bug!
What I don't get from the code is how you know that the tooltip should be removed (what in the isTargetNotATimeEntry condition indicates that the tooltip should be removed)?

@philippotto
Copy link
Member Author

What I don't get from the code is how you know that the tooltip should be removed (what in the isTargetNotATimeEntry condition indicates that the tooltip should be removed)?

In general, the tooltip should only be visible when the mouse hovers over a time entry rectangle (that's how the library works by default). So, if the mouse is not over such a rect, we can remove the tooltip. Consequently, the user cannot copy&paste something from within the tooltip, but, as I said, the default behavior of the library is like that. Hope that's fine :)

@philippotto philippotto merged commit fa344fd into master Aug 7, 2019
@normanrz normanrz deleted the fix-sticky-tooltip branch August 12, 2019 09:45
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

Successfully merging this pull request may close these issues.

2 participants