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

[BUG] Using globalCloseEvents with clickOutsideAnchor #1229

Open
richhapal opened this issue Oct 9, 2024 · 3 comments
Open

[BUG] Using globalCloseEvents with clickOutsideAnchor #1229

richhapal opened this issue Oct 9, 2024 · 3 comments
Labels

Comments

@richhapal
Copy link

richhapal commented Oct 9, 2024

Bug description
I want that if i click out tooltip that it should not be close but using clickOutSideAnchor it close tooltip but when we click on tooltip content it also close so can you tell me is there any key inside globalCloseEvents that close tooltip , click anywhere except tooltip it self.

Version of Package
5.28.0

To Reproduce
Steps to reproduce the behavior.

Expected behavior
When click on Tooltip it self it should not close tooltip but click anywhere it should be close.

Screenshots
<Tooltip
anchorSelect='#poll-icon'
id='tool_tip_poll_icon'
isOpen={showPostPollToolTip} // check is any other post poll occur
content={Poll started at ${isAnotherPostPollActiveRef.current.pollTimeFormat || '' } Click here to attempt.}
place='bottom-end'
className={tooltipClass}
setIsOpen={setShowPostPollToolTip}
globalCloseEvents={{ clickOutsideAnchor: true }}
/>
)}

Desktop (please complete the following information if possible or delete this section):

  • OS: Mac
  • Browser [Any]
  • Frameworks [ React 18]
@richhapal richhapal added the Bug label Oct 9, 2024
@danielbarion
Copy link
Member

Hi @richhapal, I'm not sure I understand the issue, can you please create a reproducible example by editing this sandbox: https://codesandbox.io/p/sandbox/gallant-leftpad-8kvtn7 ?

So I can take a detailed look.

Thanks!

@richhapal
Copy link
Author

richhapal commented Oct 22, 2024

I want to implement globalCloseEvents={{ clickOutsideAnchor: true }} so thing is that during click on toolitp it self, it close it self bcz you have 'pointer-event:none' property added in on css class. I override that so it work for me now.

@gabrieljablonski
Copy link
Member

@richhapal you can use the clickable tooltip prop to achieve that, instead of overriding the CSS directly.

As I understand, that fixes your issue, right? Please close it if so. If not, please provide more information.

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

No branches or pull requests

3 participants