Handle enter button on login/registration
This commit is contained in:
parent
d22b1defc8
commit
e23b6db257
2 changed files with 15 additions and 0 deletions
|
@ -44,6 +44,11 @@ struct LoginView: View {
|
|||
.textFieldStyle(RoundedBorderTextFieldStyle())
|
||||
.textContentType(UITextContentType.password)
|
||||
.textContentType(.password)
|
||||
.onSubmit {
|
||||
Task {
|
||||
await self.dataStore.login(username: self.username, password: self.password)
|
||||
}
|
||||
}
|
||||
Button("action_login", action: {
|
||||
Task {
|
||||
await self.dataStore.login(username: self.username, password: self.password)
|
||||
|
|
|
@ -34,6 +34,16 @@ struct RegistrationView: View {
|
|||
SecureField("prompt_confirm_password", text: self.$confirmedPassword)
|
||||
.textFieldStyle(RoundedBorderTextFieldStyle())
|
||||
.textContentType(UITextContentType.newPassword)
|
||||
.onSubmit {
|
||||
Task {
|
||||
await self.dataStore.register(
|
||||
username: self.username,
|
||||
email: self.email,
|
||||
password: self.password,
|
||||
confirmPassword: self.confirmedPassword
|
||||
)
|
||||
}
|
||||
}
|
||||
Button("action_register", action: {
|
||||
Task {
|
||||
await self.dataStore.register(
|
||||
|
|
Loading…
Reference in a new issue