Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Tooltips appear with old contents after being undefined #972
I'm submitting a ...
Codesandbox Case (Bug Reports)
Once a tooltip is defined for a component, it cannot be undefined. In other words, you cannot make tooltips go away.
Note, the same odd behavior is exhibited for both
If I define a tooltip as
Minimal reproduction of the problem with instructions
See my code sandbox link above for an example.
Say that I have a state property called
If I later render this component with the state of
However, if my button had been defined like this, then the tooltip would toggle as expected:
So once tooltips exist, they can be changed, but they cannot be removed. This would seem to be a bug in whatever listener mechanism is driving the tooltips. If the tooltip property is undefined, then any existing listeners for that tooltip need to be removed.
Please tell us about your environment:
After looking at the code, my guess is that this is due to Button.js (and other similar tooltip-using components) not properly destroying tooltips when the value changes. For example, in Button.js I'm guessing this might help:
Right now that
Remember, a fix like this is needed in every component that supports tooltips.