Fixed hiding password even when "Hinzufügen" button gets clicked
This commit is contained in:
parent
72bc20ebd1
commit
6a5dd98d8d
|
@ -110,7 +110,7 @@ fun AddAccountDialog(
|
|||
|
||||
Spacer(modifier = Modifier.height(12.dp))
|
||||
|
||||
PasswordTextField(password, onChange = { password = it }, onEnterPressed = { confirmCalled() })
|
||||
PasswordTextField(password, forceHidePassword = if (isAddingAccount) true else null, onChange = { password = it }, onEnterPressed = { confirmCalled() })
|
||||
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
}
|
||||
|
|
|
@ -22,6 +22,10 @@ fun PasswordTextField(password: String = "", label: String = "Passwort", onEnter
|
|||
|
||||
var passwordVisible by remember { mutableStateOf(false) }
|
||||
|
||||
if (forceHidePassword != null) {
|
||||
passwordVisible = !!!forceHidePassword
|
||||
}
|
||||
|
||||
OutlinedTextField(
|
||||
value = password,
|
||||
onValueChange = { onChange(it) },
|
||||
|
@ -41,10 +45,6 @@ fun PasswordTextField(password: String = "", label: String = "Passwort", onEnter
|
|||
)
|
||||
},
|
||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password),
|
||||
onEnterPressed = {
|
||||
passwordVisible = false // actually only senseful for AddAccountDialog so that password isn't visible during (long) communication process with bank server
|
||||
|
||||
onEnterPressed?.invoke()
|
||||
}
|
||||
onEnterPressed = onEnterPressed
|
||||
)
|
||||
}
|
Loading…
Reference in New Issue