Most of our projects have a need to display tooltips. Those tooltips can vary in purpose. They can be as simple as some text that appears on hover. But sometimes it has to be an interactive element. Think of a contextual menu that appears on right mouse click. How do you close that tooltip?

First there is most obvious way — if you opened it with a button then close it with a button.

Sure, it’s dead simple. But it’s completely uncontrollable from outside this element.