Clicking outside component

So I’ve got this little typeahead editor component. And I’d like the window showing the options menu to disappear when the user clicks outside of the TextEditor or ListBox, and/or maybe if the application loses focus.

Any ideas how to detect that?

Hold that thought - just looking at the CalloutBox code…

Is there a reason this function isn’t exposed in the API?

Also - I’ve got dismissing when the application doesn’t have focus. I can dismiss when keyboard focus moves. But how do I detect the user clicking outside the bounds of my component? Do I have to be modal for that? And if I am modal how do I pass the mouse event through?

What about being a global mouse listener:


Yep. That works :slight_smile: