Skip to content

fix hover event not triggered on consecutive empty bins (count=0) with hovermode:'x' for histogram #7503

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Lexachoc
Copy link
Contributor

@Lexachoc Lexachoc commented Jul 31, 2025

This PR fixes #7502

Description

Fixes a bug where hovermode:'x' (this PR also works for other hovermodes like 'x unified', 'y', 'y unified') on histogram would not trigger hover events over consecutive zero-count bins.
Previously, hovering over empty bins would keep reporting the first empty binNumber, causing stale hover data and breaking expected behavior.

Changes

Ensure hover events fire consistently across all empty bins. Correctly report the actual binNumber (and trigger hover event).

Before & After

See the fixed look in #7502 (comment)

@gvwilson gvwilson requested a review from camdecoster August 1, 2025 15:32
@gvwilson gvwilson added community community contribution P1 needed for current cycle fix fixes something broken labels Aug 1, 2025
Copy link
Contributor

@camdecoster camdecoster left a comment

Choose a reason for hiding this comment

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

@Lexachoc thanks for the bug and fix! In the future, could you please add a description and list of changes? Your bug report contains a good deal of information, but it would be helpful to have some of that in the PR. I always appreciate a one line fix. I added one small suggestion and I wrote a test for this situation (based on your Pen). Good work!

no need to coerce binNumber from integer to string as suggested

Co-authored-by: Cameron DeCoster <[email protected]>
@Lexachoc
Copy link
Contributor Author

Lexachoc commented Aug 1, 2025

@Lexachoc thanks for the bug and fix! In the future, could you please add a description and list of changes? Your bug report contains a good deal of information, but it would be helpful to have some of that in the PR. I always appreciate a one line fix. I added one small suggestion and I wrote a test for this situation (based on your Pen). Good work!

Thanks for the review and test! I've changed according to your suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community community contribution fix fixes something broken P1 needed for current cycle
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hover event not triggered on consecutive empty bins (count=0) with hovermode:'x' for histogram
3 participants