wantNoReturns

The wantNoReturns property forces a text field to reject newline characters when the user presses the RETURN key.

Usage

By default, text fields like TextEdit insert a newline (ASCII 10) character in the text when the user presses the RETURN key. As the RETURN key is typically used to fire the accept action to validate the dialog, you can force the field to reject RETURN keys with this property.

The user can still enter newline characters with Shift-RETURN or Control-RETURN, if these keys are not bound to actions.