Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Update tooltips rendered in portal. Fix #793. #331

Merged
merged 1 commit into from
Jan 22, 2018

Conversation

parkerziegler
Copy link
Contributor

This PR should fix issue #793 Tooltips in VoronoiContainer stay showing after leaving chart. Tooltips rendered in a portal were not being removed because render was never being called on the <Portal /> component after the portal was "deregistered." Calling this.forceUpdate after unregistering the portal forces a re-render, which returns an empty object for the children that should be rendered in the portal and removes the tooltip. For example:

formidable-victory-portal-tooltip

Notice that the tooltips are being rendered in the <Portal />, but they are properly unmounting when the user leaves the bounding area.

Local tests for this code were performed using the lank workflow, i.e. changes were made to victory-core and tested using victory-voronoi-container-demo.js from a sibling local version of victory-chart. To get the tooltips to render in the portal, comment out this line from victory-voronoi-container.js in your local install of victory-chart.

Copy link
Contributor

@david-davidson david-davidson left a comment

Choose a reason for hiding this comment

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

Good find!

@boygirl boygirl merged commit 0f00e37 into master Jan 22, 2018
@boygirl boygirl deleted the fix/update-portal-tooltip branch January 22, 2018 21:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tooltips in VoronoiContainer stay showing after leaving chart
3 participants