mirror of
https://github.com/ProtonMail/protoncore_android.git
synced 2026-05-15 09:50:41 +00:00
fix(auth): Issues with focus and hardware keyboard on the login screen.
When using hardware keyboard on the login screen, focus would jump from the input field to the back button, which resulted in navigating back.
This commit is contained in:
+1
-1
@@ -278,7 +278,7 @@ private fun PasswordForm(
|
||||
ProtonPasswordOutlinedTextFieldWithError(
|
||||
text = password,
|
||||
onValueChanged = { password = it },
|
||||
enabled = enabled,
|
||||
readOnly = !enabled,
|
||||
errorText = if (hasValidationError) "" else null,
|
||||
requestFocus = { true },
|
||||
onFocusChanged = { if (it) onPasswordInputFocused() },
|
||||
|
||||
+1
-1
@@ -315,7 +315,7 @@ private fun LoginForm(
|
||||
textChange.value = textChange.value.second to new
|
||||
username = new
|
||||
},
|
||||
enabled = enabled,
|
||||
readOnly = !enabled,
|
||||
errorText = if (hasValidationError) assistiveText else null,
|
||||
requestFocus = { initialUsername == null },
|
||||
onFocusChanged = { if (it) onUsernameInputFocused() },
|
||||
|
||||
+2
@@ -135,6 +135,7 @@ fun ProtonOutlinedTextFieldWithError(
|
||||
onValueChanged: (String) -> Unit,
|
||||
trailingIcon: @Composable (() -> Unit)? = null,
|
||||
visualTransformation: VisualTransformation = VisualTransformation.None,
|
||||
readOnly: Boolean = false,
|
||||
) {
|
||||
val focusRequester = remember { FocusRequester() }
|
||||
var textFieldLoaded by remember { mutableStateOf(false) }
|
||||
@@ -144,6 +145,7 @@ fun ProtonOutlinedTextFieldWithError(
|
||||
onValueChange = onValueChanged,
|
||||
colors = TextFieldDefaults.protonOutlineTextFieldColors(),
|
||||
enabled = enabled,
|
||||
readOnly = readOnly,
|
||||
isError = errorText != null,
|
||||
keyboardOptions = keyboardOptions,
|
||||
keyboardActions = keyboardActions,
|
||||
|
||||
+2
@@ -73,6 +73,7 @@ fun ProtonPasswordOutlinedTextFieldWithError(
|
||||
placeholder: (@Composable () -> Unit)? = null,
|
||||
singleLine: Boolean = false,
|
||||
onValueChanged: (String) -> Unit,
|
||||
readOnly: Boolean = false,
|
||||
) {
|
||||
var passwordVisualTransformationEnabled by remember(passwordVisible) {
|
||||
mutableStateOf(passwordVisible)
|
||||
@@ -85,6 +86,7 @@ fun ProtonPasswordOutlinedTextFieldWithError(
|
||||
onValueChange = onValueChanged,
|
||||
colors = TextFieldDefaults.protonOutlineTextFieldColors(),
|
||||
enabled = enabled,
|
||||
readOnly = readOnly,
|
||||
isError = errorText != null,
|
||||
keyboardOptions = keyboardOptions,
|
||||
keyboardActions = keyboardActions,
|
||||
|
||||
Reference in New Issue
Block a user