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

All tooltips are visible instead of current #283

Closed
VanDavv opened this issue Apr 6, 2017 · 6 comments · Fixed by #433
Closed

All tooltips are visible instead of current #283

VanDavv opened this issue Apr 6, 2017 · 6 comments · Fixed by #433

Comments

@VanDavv
Copy link

VanDavv commented Apr 6, 2017

Copied from #89 since it still occurs:

When several tooltips are instantiated on a single page, the data-event click doesn't act fully as a toggle to hide all active tooltips. Not sure if this is the desired behavior but it would make sense that only the current tooltip be activated at a time.

@monrus
Copy link

monrus commented Jun 20, 2017

what with this issue?

@apandichi
Copy link
Contributor

apandichi commented Nov 2, 2017

Hey @wwayne, any chance we can get this fixed?
I created a simple React project that demonstrates this issue:
https://github.com/apandichi/demo-tooltip-hide-issue

Steps to reproduce the problem:

  1. Click the first face.
  2. Click the second face.

screenshot from 2017-11-02 14-46-33

I expect that the first tooltip is hidden (as per globalEventOff='click'). Instead, both tooltips are displayed.

@mikebabb
Copy link

Is there a fix planned for this issue? I'm guessing not given its age. It can apparently be resolved by only having one tooltip component on a given page, but it'd be great to not have to refactor the way tooltips have been implemented across our application just to work around this. eventPropagationMode and globalEventOff don't solve it 😞

@apandichi
Copy link
Contributor

Pinging @aronhelser as he seems to be more active lately

@aronhelser
Copy link
Collaborator

I won't be able to solve it, but a PR would be welcome. Seems like looking at what happens inside the globalEventOff handler is a place to start...

apandichi added a commit to apandichi/react-tooltip that referenced this issue Sep 19, 2018
apandichi added a commit to apandichi/demo-tooltip-hide-issue that referenced this issue Sep 19, 2018
Use isCapture prop to hide tooltip when another is clicked. 
See issue ReactTooltip/react-tooltip#283 and the pull request ReactTooltip/react-tooltip#433
@apandichi
Copy link
Contributor

@aronhelser Please see the referenced PR and the my updated demo app. This seems to have solved the issue.

Please review, I'm not sure if I dealt with this correctly. I used the isCapture from props instead of the isCapture() decorator. I couldn't figure out what the target is supposed to be in that global scope where globalEventOff is handled.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants