Removed that pressing Enter starts money transfer. Just results in unwanted transfers
This commit is contained in:
parent
ac8824634e
commit
b00a14b3c7
|
@ -120,7 +120,7 @@ struct TransferMoneyDialog: View {
|
||||||
|
|
||||||
Section {
|
Section {
|
||||||
LabelledUIKitTextField(label: "Recipient Name", text: $recipientName, focusOnStart: true, focusNextTextFieldOnReturnKeyPress: true,
|
LabelledUIKitTextField(label: "Recipient Name", text: $recipientName, focusOnStart: true, focusNextTextFieldOnReturnKeyPress: true,
|
||||||
isFocusedChanged: recipientNameIsFocusedChanged, actionOnReturnKeyPress: handleReturnKeyPress, textChanged: enteredRecipientNameChanged)
|
isFocusedChanged: recipientNameIsFocusedChanged, textChanged: enteredRecipientNameChanged)
|
||||||
.padding(.bottom, 0)
|
.padding(.bottom, 0)
|
||||||
|
|
||||||
recipientNameValidationResult.map { validationError in
|
recipientNameValidationResult.map { validationError in
|
||||||
|
@ -134,8 +134,7 @@ struct TransferMoneyDialog: View {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LabelledUIKitTextField(label: "Recipient IBAN", text: $recipientIban, autocapitalizationType: .allCharacters, focusNextTextFieldOnReturnKeyPress: true, isFocusedChanged: validateRecipientIbanOnFocusLost,
|
LabelledUIKitTextField(label: "Recipient IBAN", text: $recipientIban, autocapitalizationType: .allCharacters, focusNextTextFieldOnReturnKeyPress: true, isFocusedChanged: validateRecipientIbanOnFocusLost, textChanged: enteredRecipientIbanChanged)
|
||||||
actionOnReturnKeyPress: handleReturnKeyPress, textChanged: enteredRecipientIbanChanged)
|
|
||||||
|
|
||||||
recipientIbanValidationResult.map { validationError in
|
recipientIbanValidationResult.map { validationError in
|
||||||
ValidationLabel(validationError)
|
ValidationLabel(validationError)
|
||||||
|
@ -149,7 +148,7 @@ struct TransferMoneyDialog: View {
|
||||||
|
|
||||||
Section {
|
Section {
|
||||||
LabelledUIKitTextField(label: "Amount", text: $amount, keyboardType: .decimalPad, addDoneButton: true,
|
LabelledUIKitTextField(label: "Amount", text: $amount, keyboardType: .decimalPad, addDoneButton: true,
|
||||||
focusNextTextFieldOnReturnKeyPress: true, actionOnReturnKeyPress: handleReturnKeyPress, textChanged: checkAndValidateEnteredAmount)
|
focusNextTextFieldOnReturnKeyPress: true, textChanged: checkAndValidateEnteredAmount)
|
||||||
|
|
||||||
amountValidationResult.map { validationError in
|
amountValidationResult.map { validationError in
|
||||||
ValidationLabel(validationError)
|
ValidationLabel(validationError)
|
||||||
|
@ -164,7 +163,7 @@ struct TransferMoneyDialog: View {
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
|
|
||||||
UIKitTextField("Enter reference", text: $reference, actionOnReturnKeyPress: handleReturnKeyPress, textChanged: validateReference)
|
UIKitTextField("Enter reference", text: $reference, textChanged: validateReference)
|
||||||
}
|
}
|
||||||
|
|
||||||
referenceValidationResult.map { validationError in
|
referenceValidationResult.map { validationError in
|
||||||
|
@ -219,17 +218,6 @@ struct TransferMoneyDialog: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private func handleReturnKeyPress() -> Bool {
|
|
||||||
if self.isRequiredDataEntered() && isTransferringMoney == false {
|
|
||||||
self.transferMoney()
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private func validateAllFields() {
|
private func validateAllFields() {
|
||||||
self.validateRecipientNameOnFocusLost()
|
self.validateRecipientNameOnFocusLost()
|
||||||
self.validateRecipientIbanOnFocusLost()
|
self.validateRecipientIbanOnFocusLost()
|
||||||
|
|
Loading…
Reference in New Issue