Fixed spelling of focused
This commit is contained in:
parent
6f510fdaef
commit
841ad7dea5
|
@ -25,7 +25,7 @@ struct LabelledUIKitTextField: View {
|
|||
)
|
||||
}
|
||||
|
||||
var isFocussedChanged: ((Bool) -> Void)? = nil
|
||||
var isFocusedChanged: ((Bool) -> Void)? = nil
|
||||
|
||||
|
||||
var isUserInputEnabled: Bool = true
|
||||
|
@ -48,7 +48,7 @@ struct LabelledUIKitTextField: View {
|
|||
|
||||
UIKitTextField(placeholder, text: $text, keyboardType: keyboardType, autocapitalizationType: autocapitalizationType, isPasswordField: isPasswordField,
|
||||
focusOnStart: focusOnStart, focusNextTextFieldOnReturnKeyPress: focusNextTextFieldOnReturnKeyPress, focusTextField: focusTextFieldBinding,
|
||||
isFocussedChanged: isFocussedChanged, textAlignment: .right, isUserInputEnabled: isUserInputEnabled,
|
||||
isFocusedChanged: isFocusedChanged, textAlignment: .right, isUserInputEnabled: isUserInputEnabled,
|
||||
actionOnReturnKeyPress: actionOnReturnKeyPress, textChanged: textChanged)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ struct UIKitTextField: UIViewRepresentable {
|
|||
private var focusNextTextFieldOnReturnKeyPress = false
|
||||
@Binding private var focusTextField: Bool
|
||||
|
||||
private var isFocussedChanged: ((Bool) -> Void)? = nil
|
||||
private var isFocusedChanged: ((Bool) -> Void)? = nil
|
||||
|
||||
private var textAlignment: NSTextAlignment = .natural
|
||||
private var isUserInputEnabled: Bool = true
|
||||
|
@ -30,7 +30,7 @@ struct UIKitTextField: UIViewRepresentable {
|
|||
|
||||
init(_ titleKey: String, text: Binding<String>, keyboardType: UIKeyboardType = .default, autocapitalizationType: UITextAutocapitalizationType = .sentences,
|
||||
isPasswordField: Bool = false, focusOnStart: Bool = false, focusNextTextFieldOnReturnKeyPress: Bool = false, focusTextField: Binding<Bool> = .constant(false),
|
||||
isFocussedChanged: ((Bool) -> Void)? = nil,
|
||||
isFocusedChanged: ((Bool) -> Void)? = nil,
|
||||
textAlignment: NSTextAlignment = .natural, isUserInputEnabled: Bool = true,
|
||||
actionOnReturnKeyPress: (() -> Bool)? = nil, textChanged: ((String) -> Void)? = nil) {
|
||||
self.placeholder = titleKey
|
||||
|
@ -43,7 +43,7 @@ struct UIKitTextField: UIViewRepresentable {
|
|||
self.focusOnStart = focusOnStart
|
||||
self.focusNextTextFieldOnReturnKeyPress = focusNextTextFieldOnReturnKeyPress
|
||||
self._focusTextField = focusTextField
|
||||
self.isFocussedChanged = isFocussedChanged
|
||||
self.isFocusedChanged = isFocusedChanged
|
||||
|
||||
self.textAlignment = textAlignment
|
||||
self.isUserInputEnabled = isUserInputEnabled
|
||||
|
@ -91,7 +91,7 @@ struct UIKitTextField: UIViewRepresentable {
|
|||
|
||||
|
||||
func makeCoordinator() -> UIKitTextField.Coordinator {
|
||||
return Coordinator(text: $text, focusNextTextFieldOnReturnKeyPress: focusNextTextFieldOnReturnKeyPress, isFocussedChanged: isFocussedChanged,
|
||||
return Coordinator(text: $text, focusNextTextFieldOnReturnKeyPress: focusNextTextFieldOnReturnKeyPress, isFocusedChanged: isFocusedChanged,
|
||||
isUserInputEnabled: isUserInputEnabled, actionOnReturnKeyPress: actionOnReturnKeyPress, textChanged: textChanged)
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ struct UIKitTextField: UIViewRepresentable {
|
|||
|
||||
private var focusNextTextFieldOnReturnKeyPress: Bool
|
||||
|
||||
private var isFocussedChanged: ((Bool) -> Void)? = nil
|
||||
private var isFocusedChanged: ((Bool) -> Void)? = nil
|
||||
|
||||
private var isUserInputEnabled: Bool
|
||||
|
||||
|
@ -111,12 +111,12 @@ struct UIKitTextField: UIViewRepresentable {
|
|||
private var textChanged: ((String) -> Void)?
|
||||
|
||||
|
||||
init(text: Binding<String>, focusNextTextFieldOnReturnKeyPress: Bool, isFocussedChanged: ((Bool) -> Void)? = nil, isUserInputEnabled: Bool,
|
||||
init(text: Binding<String>, focusNextTextFieldOnReturnKeyPress: Bool, isFocusedChanged: ((Bool) -> Void)? = nil, isUserInputEnabled: Bool,
|
||||
actionOnReturnKeyPress: (() -> Bool)? = nil, textChanged: ((String) -> Void)? = nil) {
|
||||
_text = text
|
||||
|
||||
self.focusNextTextFieldOnReturnKeyPress = focusNextTextFieldOnReturnKeyPress
|
||||
self.isFocussedChanged = isFocussedChanged
|
||||
self.isFocusedChanged = isFocusedChanged
|
||||
self.isUserInputEnabled = isUserInputEnabled
|
||||
|
||||
self.actionOnReturnKeyPress = actionOnReturnKeyPress
|
||||
|
@ -128,7 +128,7 @@ struct UIKitTextField: UIViewRepresentable {
|
|||
func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
|
||||
if isUserInputEnabled {
|
||||
if textField.isFirstResponder {
|
||||
isFocussedChanged?(true)
|
||||
isFocusedChanged?(true)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ struct UIKitTextField: UIViewRepresentable {
|
|||
}
|
||||
|
||||
func textFieldDidEndEditing(_ textField: UITextField, reason: UITextField.DidEndEditingReason) {
|
||||
isFocussedChanged?(false)
|
||||
isFocusedChanged?(false)
|
||||
}
|
||||
|
||||
func textFieldDidChangeSelection(_ textField: UITextField) {
|
||||
|
|
|
@ -115,7 +115,7 @@ struct TransferMoneyDialog: View {
|
|||
|
||||
Section {
|
||||
LabelledUIKitTextField(label: "Remittee Name", text: $remitteeName, focusOnStart: true, focusNextTextFieldOnReturnKeyPress: true,
|
||||
isFocussedChanged: remitteeNameIsFocussedChanged, actionOnReturnKeyPress: handleReturnKeyPress, textChanged: enteredRemitteeNameChanged)
|
||||
isFocusedChanged: remitteeNameisFocusedChanged, actionOnReturnKeyPress: handleReturnKeyPress, textChanged: enteredRemitteeNameChanged)
|
||||
.padding(.bottom, 0)
|
||||
|
||||
remitteeNameValidationResult.map { validationError in
|
||||
|
@ -129,8 +129,8 @@ struct TransferMoneyDialog: View {
|
|||
}
|
||||
}
|
||||
|
||||
LabelledUIKitTextField(label: "Remittee IBAN", text: $remitteeIban, autocapitalizationType: .allCharacters, focusNextTextFieldOnReturnKeyPress: true, isFocussedChanged: validateRemitteeIbanOnFocusLost,
|
||||
actionOnReturnKeyPress: handleReturnKeyPress, textChanged: remitteeIbanIsFocussedChanged)
|
||||
LabelledUIKitTextField(label: "Remittee IBAN", text: $remitteeIban, autocapitalizationType: .allCharacters, focusNextTextFieldOnReturnKeyPress: true, isFocusedChanged: validateRemitteeIbanOnFocusLost,
|
||||
actionOnReturnKeyPress: handleReturnKeyPress, textChanged: remitteeIbanisFocusedChanged)
|
||||
|
||||
remitteeIbanValidationResult.map { validationError in
|
||||
ValidationLabel(validationError)
|
||||
|
@ -216,8 +216,8 @@ struct TransferMoneyDialog: View {
|
|||
}
|
||||
|
||||
|
||||
private func remitteeNameIsFocussedChanged(_ isFocussed: Bool) {
|
||||
if isFocussed == false {
|
||||
private func remitteeNameisFocusedChanged(_ isFocused: Bool) {
|
||||
if isFocused == false {
|
||||
validateRemitteeNameOnFocusLost()
|
||||
|
||||
self.showRemitteeAutocompleteList = false
|
||||
|
@ -261,14 +261,14 @@ struct TransferMoneyDialog: View {
|
|||
}
|
||||
|
||||
|
||||
private func remitteeIbanIsFocussedChanged(_ enteredIban: String) {
|
||||
private func remitteeIbanisFocusedChanged(_ enteredIban: String) {
|
||||
validateField($remitteeIban, $remitteeIbanValidationResult, $isValidRemitteeIbanEntered) { inputValidator.validateIbanWhileTyping(ibanToTest: enteredIban) }
|
||||
|
||||
tryToGetBicFromIban(enteredIban)
|
||||
}
|
||||
|
||||
private func validateRemitteeIbanOnFocusLost(_ isFocussed: Bool) {
|
||||
if isFocussed == false {
|
||||
private func validateRemitteeIbanOnFocusLost(_ isFocused: Bool) {
|
||||
if isFocused == false {
|
||||
validateRemitteeIbanOnFocusLost()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue