diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/AddAccountDialog.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/AddAccountDialog.kt index b9e8c60..0117577 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/AddAccountDialog.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/dialogs/AddAccountDialog.kt @@ -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)) } diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/forms/PasswordTextField.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/forms/PasswordTextField.kt index 270e54d..0c10d87 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/forms/PasswordTextField.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/forms/PasswordTextField.kt @@ -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 ) } \ No newline at end of file