Fix treemap tooltip crash#3579
Merged
Merged
Conversation
Comment on lines
+95
to
+103
| render: (args: Record<string, any>) => { | ||
| return ( | ||
| <ResponsiveContainer width="100%" height={400}> | ||
| <Treemap {...args}> | ||
| <Tooltip /> | ||
| </Treemap> | ||
| </ResponsiveContainer> | ||
| ); | ||
| }, |
Contributor
There was a problem hiding this comment.
You could add a play function to hover over the chart, and then verify that the tooltip is rendered. Thus such an issue could be auto-detected the next time.
nikolasrieble
approved these changes
May 10, 2023
nikolasrieble
left a comment
Contributor
There was a problem hiding this comment.
Good to go for the fix - one suggestion for improving the test - might make sense to invest the extra time now.
Member
Author
|
Agreed, but I don't have the time to get a test out (gave it an attempt, couldn't figure it out in the time I had) - I will merge this for the fix and follow up later |
renovate Bot
referenced
this pull request
in UI5/webcomponents-react
May 11, 2023
[](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [recharts](https://togithub.com/recharts/recharts) | [`2.5.0` -> `2.6.2`](https://renovatebot.com/diffs/npm/recharts/2.5.0/2.6.2) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>recharts/recharts</summary> ### [`v2.6.2`](https://togithub.com/recharts/recharts/releases/tag/v2.6.2) [Compare Source](https://togithub.com/recharts/recharts/compare/v2.6.1...v2.6.2) fix bug where ts types error and cannot be generated when exporting in a consuming package. Fixes [https://github.com/recharts/recharts/pull/3581](https://togithub.com/recharts/recharts/pull/3581) #### What's Changed - fix: sankey types - add explicitly return type for renderTooltip by [@​ckifer](https://togithub.com/ckifer) in [https://github.com/recharts/recharts/pull/3581](https://togithub.com/recharts/recharts/pull/3581) **Full Changelog**: recharts/recharts@v2.6.1...v2.6.2 ### [`v2.6.1`](https://togithub.com/recharts/recharts/releases/tag/v2.6.1) [Compare Source](https://togithub.com/recharts/recharts/compare/v2.6.0...v2.6.1) #### What's Changed Quick fix for a bug crashing treemaps with tooltips in 2.6.0 - Fix treemap tooltip crash by [@​ckifer](https://togithub.com/ckifer) in [https://github.com/recharts/recharts/pull/3579](https://togithub.com/recharts/recharts/pull/3579) **Full Changelog**: recharts/recharts@v2.6.0...v2.6.1 ### [`v2.6.0`](https://togithub.com/recharts/recharts/releases/tag/v2.6.0) [Compare Source](https://togithub.com/recharts/recharts/compare/v2.5.0...v2.6.0) #### What's Changed Storybook documentation updates as well as our first accessibility feature thanks to [@​julianna-langston](https://togithub.com/julianna-langston) and some refactoring to function components! ##### Feat - \[a11y] Keyboard navigation support for categorical charts by [@​julianna-langston](https://togithub.com/julianna-langston) in [https://github.com/recharts/recharts/pull/3546](https://togithub.com/recharts/recharts/pull/3546) - See docs [here](https://release--63da8268a0da9970db6992aa.chromatic.com/?path=/docs/api-accessibility--docs) ##### Fix - Update type for `equidistantPreserveStart` axis interval by [@​frontier159](https://togithub.com/frontier159) in [https://github.com/recharts/recharts/pull/3511](https://togithub.com/recharts/recharts/pull/3511) - Stop focusing on tooltip when displayed - use event listeners instead by [@​ArkaFred](https://togithub.com/ArkaFred) in [https://github.com/recharts/recharts/pull/3515](https://togithub.com/recharts/recharts/pull/3515) ##### Docs - lots of storybook changes - [go check it out](https://release--63da8268a0da9970db6992aa.chromatic.com/)! - Getting close to parity with existing docs on recharts.org - Added accessibility add-on - Added accessibility docs to go with the keyboard navigation support - Storybook 7 stable - Much more! ##### Refactor - refactor: `Curve` to function component by [@​akamfoad](https://togithub.com/akamfoad) in [https://github.com/recharts/recharts/pull/3477](https://togithub.com/recharts/recharts/pull/3477) - refactor: `PolarGrid` to function component by [@​akamfoad](https://togithub.com/akamfoad) in [https://github.com/recharts/recharts/pull/3471](https://togithub.com/recharts/recharts/pull/3471) - refactor: `Cross` to component function by [@​akamfoad](https://togithub.com/akamfoad) in [https://github.com/recharts/recharts/pull/3475](https://togithub.com/recharts/recharts/pull/3475) - refactor: tooltip to function component by [@​ckifer](https://togithub.com/ckifer) in [https://github.com/recharts/recharts/pull/3336](https://togithub.com/recharts/recharts/pull/3336) - fix: defaultProps of tooltip, fix viewBox by [@​ckifer](https://togithub.com/ckifer) in [https://github.com/recharts/recharts/pull/3554](https://togithub.com/recharts/recharts/pull/3554) - refactor: `Text` to function component by [@​akamfoad](https://togithub.com/akamfoad) in [https://github.com/recharts/recharts/pull/3463](https://togithub.com/recharts/recharts/pull/3463) #### New Contributors - [@​akamfoad](https://togithub.com/akamfoad) made their first contribution in [https://github.com/recharts/recharts/pull/3466](https://togithub.com/recharts/recharts/pull/3466) - [@​nicholasgcoles](https://togithub.com/nicholasgcoles) made their first contribution in [https://github.com/recharts/recharts/pull/3467](https://togithub.com/recharts/recharts/pull/3467) - [@​linhuiw](https://togithub.com/linhuiw) made their first contribution in [https://github.com/recharts/recharts/pull/3508](https://togithub.com/recharts/recharts/pull/3508) - [@​frontier159](https://togithub.com/frontier159) made their first contribution in [https://github.com/recharts/recharts/pull/3511](https://togithub.com/recharts/recharts/pull/3511) - [@​ArkaFred](https://togithub.com/ArkaFred) made their first contribution in [https://github.com/recharts/recharts/pull/3515](https://togithub.com/recharts/recharts/pull/3515) - [@​julianna-langston](https://togithub.com/julianna-langston) made their first contribution in [https://github.com/recharts/recharts/pull/3540](https://togithub.com/recharts/recharts/pull/3540) **Full Changelog**: recharts/recharts@v2.5.0...v2.6.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/SAP/ui5-webcomponents-react). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS43NC4wIiwidXBkYXRlZEluVmVyIjoiMzUuNzUuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Lukas Harbarth <[email protected]>
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.
Description
Bug released in 2.6 with refactor of Tooltip to a function component. Add optionals to prevent crashing when
coordinateisnull.This resulted in other errors surrounding event pooling https://legacy.reactjs.org/docs/legacy-event-pooling.html
This isn't an issue in React 17+ but throws errors in react <17 so call e.persist() in the offending functions in
Treemap- this resolves errors in React 16 and has no effect in React 17 (see https://legacy.reactjs.org/blog/2020/08/10/react-v17-rc.html#no-event-pooling)Related Issue
#3578
Motivation and Context
Fix 2.6.0 bug #3578
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: