-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
Get tooltip content dynamically in the render method #281
Get tooltip content dynamically in the render method #281
Conversation
… of setting it in state.placeholder. This allows for the tooltip contents to change dynamically (or be hidden if you return null in the getContent prop).
Thank you for your contribution! |
@alfonsomunozpomer I think it's because you take out the code which sets |
@wbazant I think you’re right. Quite an oversight from my part... I’ll fix it tomorrow! |
…e demo page work again.
@huumanoid I’ve now tested it and everything looks fine. Notice, though, that the tooltip content changes as you move the mouse, which is the intentded behaviour at least in our use case. |
Thank you for a quick fix!
Use case you mentioned sounds interesting! As far as I understand: Is svg with a complex content relates to this use case? Why don't user pass changes to |
Precisely our use case is that we have a SVG, more specifically a Highcharts heatmap (we’re using react-highcharts). It can fire events when you hover the mouse pointer over different parts of the chart, and we pass a callback from the react-tooltip container component that changes the contents of the tooltip depending on the hovered element (i.e. the event fired). Yes, Let me know if anything is unclear. |
@huumanoid any chance of this getting merged soon? Also running into this problem. |
Also running into this problem. |
+1 Please can you merge this branch as am having the same issue. Cheers dude :-) |
Same here pls merge this fix asap thanks a lot |
+1 @huumanoid is there any hope of getting this merged in? This is definitely causing me issues I am not enjoying working around. |
+1 |
Any update on this pull request? |
Can you please merge this. Thank you |
I had the same issue, content would not reload, I fixed it in the meantime by doing the following: This case does not reload the UI when props change
This case does reload the UI when props change
|
I like this change, but it does change the behavior of the API - the left example in the last row of http://wwayne.com/react-tooltip/ uses Is there a reason this shouldn't be merged because of this? |
🎉 This PR is included in version 3.5.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
the solution is to hide and then show the tooltip on state change and if your cmp is hovered .
|
Get the tooltip content in the render method using a function instead of setting it in state.placeholder. This allows for the tooltip contents to change dynamically and react to changes to props (or be hidden if you return null in the getContent prop).