fix(charts): dismiss HorizontalBarChart callout on keyboard blur - #36488
Draft
AKnassa wants to merge 1 commit into
Draft
fix(charts): dismiss HorizontalBarChart callout on keyboard blur#36488AKnassa wants to merge 1 commit into
AKnassa wants to merge 1 commit into
Conversation
HorizontalBarChart's _hoverOff was emptied by the callout-flicker fix in PR microsoft#21750 but stayed wired to onBlur, so the callout only closed via mouse leave. Keyboard users tabbing out of a chart (or into a second chart) left the previous callout stuck open. The v9 port carried the same no-op with a ToDo comment. Revive blur dismissal in both packages, guarded by relatedTarget: focus moving within the chart root (or into the v8 Layer-portaled callout, looked up by callout id) does not dismiss, which keeps the PR microsoft#21750 flicker fix intact - locked in by guard tests that pass before and after the change. v8: full react-charting suite green (962 passed). v9: full react-charts suite matches baseline exactly (only the 6 pre-existing HeatMapChart snapshot failures remain). v8 VerticalBarChart has a sibling no-op _onBarLeave - follow-up candidate. Fixes microsoft#29925
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previous Behavior
HorizontalBarChart's tooltip never closed for keyboard users. Tabbing off the chart — or from one chart into a second one — left the first tooltip stuck open. The blur handler had been intentionally emptied years ago to fix a mouse flicker, and keyboard dismissal was never restored. The newer v9 chart carried the same empty handler with a literal "ToDo: fix" comment.
New Behavior
Moving keyboard focus out of the chart closes its tooltip, in both the v8 (
react-charting) and v9 (react-charts) packages. Moving focus between bars inside the same chart — or into the tooltip itself — does not dismiss it, so the old flicker problem cannot come back. A maintainer had explicitly welcomed this contribution in the issue.What changed
Full v8 suite green (962 tests); full v9 suite matches its baseline exactly (the only failures are 6 HeatMap snapshots that already fail on untouched master). The v8 VerticalBarChart has a sibling empty handler — flagged as a follow-up.
Related Issue(s)