Skip to content
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

How to hide VictoryTooltip after mouse out #571

Closed
catarina-lopes-pt opened this issue Apr 25, 2017 · 8 comments · Fixed by FormidableLabs/victory-core#280
Closed

How to hide VictoryTooltip after mouse out #571

catarina-lopes-pt opened this issue Apr 25, 2017 · 8 comments · Fixed by FormidableLabs/victory-core#280
Labels
Type: Bug 🐛 Oh no! A bug or unintentional behavior

Comments

@catarina-lopes-pt
Copy link

https://jsfiddle.net/2zxnhL70/

I have a strange behaviour here, when i move out the mouse from the bars, the tooltip does not disappear, only disappears when another one is visible. Am i doing anything wrong here? How can I fix this?
Thanks

@boygirl
Copy link
Contributor

boygirl commented Apr 27, 2017

@clopes-ventureoak thanks for the repro. Your code all looks correct. This looks like a bug on our end.

@boygirl boygirl added the Type: Bug 🐛 Oh no! A bug or unintentional behavior label May 2, 2017
@njtrettel
Copy link

+1
@boygirl any updated status on this?

@jeradrose
Copy link

I also was wondering about this. Looks like even the examples on the guide have the issue -- at least the ones not using a VictoryVoronoiContainer. A workaround I've found is to use a VictoryVoronoiContainer, but the downside to this, is that any part of tooltip that is outside of the chart, it gets cropped (if there's not enough padding).

@eddywashere
Copy link

From what I could tell, it looks like VictoryPortal is not updating. I added a onMouseOut event to log the props and I can see that active is false for labels but VictoryPortal doesn't pick up the change.

Workaround: I'm able to get around this by adding a ref to the container in VictoryChart containerComponent={<VictoryContainer ref={this.saveContainerRef} />}, then calling this.containerRef.portalRef.forceUpdate() when needed (onMouseOut event).

@jeradrose
Copy link

@eddywashere's solution worked for me.

@MartinMattyZahradnik
Copy link

I agree with eddywashere that VictoryPortal is not updating. For me was the solution to use this.forceupdate(). I am not happy to do this but for now seems to be easiest solution. Give it a try maybe it will save you a lot of headache :)

onMouseOut: () => [ { target: 'data', mutation: () => {}, }, { target: 'labels', mutation: () => { this.forceUpdate(); return { active: false }; } }, ],

@sindhu465
Copy link

Could you please elaborate how to do it
I need it immediately

@sindhu465
Copy link

have a strange behaviour here, when i move out the mouse from the bars, the tooltip does not disappear, only disappears when another one is visible.

Could you please help me how to disappear the tooltip on mouseout??

boygirl added a commit that referenced this issue Jul 17, 2018
add activate props, and selectionBlacklist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐛 Oh no! A bug or unintentional behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants