I want to enable pressing on the keyboard return key only when a condition occurs.
For example:
SecureField("", text:$password)
.focused($passwordFocused)
.onSubmit {
if password.count >= 8 {
joinNetwork()
}
}
.submitLabel(.join)
I want to make the return key disabled if the password does not hit the condition. Or at least change the color of the return button to gray.