Dismissing EditBox via Enter key on Mac

I see KeyboardReturnType has not been implemented for Mac.

I want to hide the EditBox when Enter is pressed.

So I am searching for \n in my string in editBoxTextChanged and then I hide the EditBox. It seems to then call editBoxReturn, which is what I want because that is where I save and validate the value.

However, it seems that the EditBox still has focus or something, because I get wrong mouse coordinates on my next click. But then if I then move the mouse and click again the mouse coordinates are correct.

It works perfect if I don’t press Enter and I just click off the EditBox, but I’d rather just hit Enter to finish the input.

Is there a better way to finish the input by pressing Enter on the EditBox? I tried setting the focus to false, but that did absolutely nothing to help.