@ -99,7 +99,7 @@ struct PlayerPopoverView: View {
. textInputAutocapitalization ( . words )
. textInputAutocapitalization ( . words )
. focused ( $ firstNameIsFocused )
. focused ( $ firstNameIsFocused )
. onSubmit {
. onSubmit {
firstName = firstName . trimmed
firstName = firstName . trimmedMultiline
lastNameIsFocused = true
lastNameIsFocused = true
}
}
. fixedSize ( )
. fixedSize ( )
@ -114,7 +114,7 @@ struct PlayerPopoverView: View {
. keyboardType ( . alphabet )
. keyboardType ( . alphabet )
. focused ( $ lastNameIsFocused )
. focused ( $ lastNameIsFocused )
. onSubmit {
. onSubmit {
lastName = lastName . trimmed
lastName = lastName . trimmedMultiline
licenseIsFocused = true
licenseIsFocused = true
}
}
. fixedSize ( )
. fixedSize ( )
@ -128,7 +128,7 @@ struct PlayerPopoverView: View {
. keyboardType ( . numberPad )
. keyboardType ( . numberPad )
. submitLabel ( . next )
. submitLabel ( . next )
. onSubmit {
. onSubmit {
license = license . trimmed
license = license . trimmedMultiline
if requiredField . contains ( . license ) {
if requiredField . contains ( . license ) {
if license . isLicenseNumber {
if license . isLicenseNumber {
amountIsFocused = true
amountIsFocused = true
@ -206,7 +206,7 @@ struct PlayerPopoverView: View {
Spacer ( )
Spacer ( )
Button ( " Confirmer " ) {
Button ( " Confirmer " ) {
if licenseIsFocused {
if licenseIsFocused {
license = license . trimmed
license = license . trimmedMultiline
if requiredField . contains ( . license ) {
if requiredField . contains ( . license ) {
if license . isLicenseNumber {
if license . isLicenseNumber {
amountIsFocused = true
amountIsFocused = true
@ -251,7 +251,7 @@ struct PlayerPopoverView: View {
}
}
func createManualPlayer ( ) {
func createManualPlayer ( ) {
let playerRegistration = PlayerRegistration ( firstName : firstName , lastName : lastName , licenceId : license . trimmed . isEmpty ? nil : license , rank : rank , sex : PlayerRegistration . PlayerSexType ( rawValue : sex ) )
let playerRegistration = PlayerRegistration ( firstName : firstName . trimmedMultiline , lastName : lastName . trimmedMultiline , licenceId : license . trimmedMultiline . isEmpty ? nil : license , rank : rank , sex : PlayerRegistration . PlayerSexType ( rawValue : sex ) )
self . creationCompletionHandler ( playerRegistration )
self . creationCompletionHandler ( playerRegistration )
}
}