Need guidance with text editor

I can’t get to work the " lose focus on click out" (or something else?) with a text editor, it requires specifically to push either enter or escape. I would like it to behave like in juce::Label, when you click out the editor closes itself, is there an option I’m missing somwhere?