react-tooltip icon indicating copy to clipboard operation
react-tooltip copied to clipboard

Stateless tooltips

Open oyeanuj opened this issue 9 years ago • 9 comments

Hi @wwayne! I've been running into some issues when I have multiple tooltips on a page, or when tooltips need to show up conditionally.

I was wondering if you've thoughts around maybe releasing a stateless tooltip that has open/close prop which determines when the tooltip is open or not?

This way, the user can control the opening and closing and the library can provide them with some useful defaults. This might also simplify the props that you have today, and allow for more complex use-cases like #144 .

Thoughts?

Thank you!

oyeanuj avatar Feb 27 '17 07:02 oyeanuj

@wwayne @huumanoid Following up to see if you guys had any thoughts on this one as well?

oyeanuj avatar Apr 18 '17 02:04 oyeanuj

Same issue here. I'm debugging right now my application, since I did not realise that we need a for every tooltip. With a long list (~500) there are big performance issue

danieleleoni avatar May 09 '17 13:05 danieleleoni

Agreed that this would be a great feature.

@oyeanuj Have you managed to figure out a workaround?

AlexNisnevich avatar May 16 '17 02:05 AlexNisnevich

@AlexNisnevich I ended up moving to https://github.com/littlebits/react-popover until this issue is resolved, as had made the fine-grained control of the tooltip much harder.

oyeanuj avatar May 17 '17 16:05 oyeanuj

Running into the same problem; have to use something else :(

I feel like being controllable is a pretty essential feature for any react component

noobG avatar Jun 19 '17 12:06 noobG

I had an issue where I wanted to close one tooltip when another one was open instead of overlapping. I ended up writing a function to set state in my component and wrote a conditional in the "data-tip" property where when I wanted it "off", I set the data-tip to an empty string. Works for now but would also like to see open/close props.

reginavlee avatar Aug 16 '17 18:08 reginavlee

@reginavlee do you have the source code for this change, I can take a look at the implementation. (I am new to front end).

pswaroopk avatar Jun 04 '19 16:06 pswaroopk

Hi guys, this will be handled on V5, thanks!

https://github.com/ReactTooltip/react-tooltip/discussions/812

danielbarion avatar Nov 09 '22 16:11 danielbarion

Hi, closing this issue due to: https://react-tooltip.com/docs/examples/state

Please feel free to create a new one if needed. Thanks!

danielbarion avatar Nov 30 '22 21:11 danielbarion