question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ternary renders prevent tooltip from opening.

See original GitHub issue

{auth.user && auth.user[0].privilege_level < 5 ? ( <Menu.Item name="Pending Tickets" data-tip="Pending Data Ops" as={Link} to="/pending-data-ops" > <Icon name="address card" /> </Menu.Item> ) : null}

The above code renders the menu item based on the user level. The Ternary wrapper stops the tooltip from rendering. This can be avoided by adding the data-tip prop to a wrapper above the ternary, maybe not a bad issue, might want to put in docs? I dunno take this info and do with it what you need lol.

This works: <div data-tip="Pending Data Ops"> {auth.user && auth.user[0].privilege_level < 5 ? ( <Menu.Item name="Pending Tickets" as={Link} to="/pending-data-ops"> <Icon name="address card" /> </Menu.Item> ) : null} </div>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
liskoXcommented, Oct 15, 2019

Hello, you have to rebuild the tooltip component with ReactTooltip.rebuild() (i did this after setState)

I did and worked for me, i can’t do your solution with my code because of the structure is a quit different. hope it will help you

1reaction
aronhelsercommented, Oct 25, 2019

Pull request welcome! Add it where you think it’s helpful and I’ll get it in.

On Fri, Oct 25, 2019 at 6:03 AM Dimitris Raptis notifications@github.com wrote:

It worked for me too. Adding it to the docs would have saved me a lot of time.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/wwayne/react-tooltip/issues/517?email_source=notifications&email_token=AEX6THITLCB4AC7W4M4UWELQQK75JA5CNFSM4JAPF4R2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECH3ZCI#issuecomment-546290825, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEX6THIU43G23GT7UJT3QALQQK75JANCNFSM4JAPF4RQ .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Conditionally activate Material UI tooltip? - Stack Overflow
In the following scenario, we will use state to set showing the tooltip when we enter the mouse over the element , and...
Read more >
Conflicts with multiple svgs in the same page #585 - GitHub
Im using Material-UI tooltip compon. ... Controlling rendering with ternary operator in JSX: When I hover the first one, it hides the second ......
Read more >
Controlling tooltips & pop-up menus with components in React
1. Open the tooltip ; isOpen and ; style states to show/hide and position the tooltip component respectively. Also, it is required to...
Read more >
Using React 16 Portals to build a global UX tooltip ...
The main purpose of this component is to render tooltips in different places across the DOM tree using React Portals functionality
Read more >
Conditional Rendering - React
In rare cases you might want a component to hide itself even though it was rendered by another component. To do this return...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found