As you can see in the documentation of
In dialogs created with CreateDialog, pressing Return is effectively equivalent to clicking the DefaultButton, and Esc to clicking the CancelButton.
If the dialog contains no DefaultButton or CancelButton, pressing Return or Esc will close the dialog without taking any other action.
I have a input field, for example, and I often press Enter key after I wrote my inputs. That what happened is that my window close immediately after that.
How can change this behavior in Dialog?