Close menu with same button as opening

This doesn’t work anymore if you click anywhere outside the widget, hence it looses focus.
Why aren’t widgets accepting key input?