PM-29442: Change 2fa field to not be a password field (#6269)

This commit is contained in:
David Perez
2025-12-15 12:58:44 -06:00
committed by GitHub
parent bdbcd5bdc2
commit 30ce512091
2 changed files with 12 additions and 3 deletions

View File

@@ -41,7 +41,7 @@ import com.bitwarden.ui.platform.components.button.BitwardenFilledButton
import com.bitwarden.ui.platform.components.button.BitwardenOutlinedButton
import com.bitwarden.ui.platform.components.dialog.BitwardenBasicDialog
import com.bitwarden.ui.platform.components.dialog.BitwardenLoadingDialog
import com.bitwarden.ui.platform.components.field.BitwardenPasswordField
import com.bitwarden.ui.platform.components.field.BitwardenTextField
import com.bitwarden.ui.platform.components.model.CardStyle
import com.bitwarden.ui.platform.components.scaffold.BitwardenScaffold
import com.bitwarden.ui.platform.components.snackbar.BitwardenSnackbarHost
@@ -263,7 +263,7 @@ private fun TwoFactorLoginScreenContent(
Spacer(modifier = Modifier.height(12.dp))
if (state.shouldShowCodeInput) {
BitwardenPasswordField(
BitwardenTextField(
value = state.codeInput,
onValueChange = onCodeInputChange,
label = stringResource(id = BitwardenString.verification_code),

View File

@@ -48,6 +48,7 @@ import androidx.compose.ui.semantics.customActions
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.TextRange
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.text.input.VisualTransformation
@@ -101,6 +102,7 @@ import kotlinx.collections.immutable.toImmutableList
* @param visualTransformation Transforms the visual representation of the input [value].
* @param keyboardType the preferred type of keyboard input.
* @param keyboardActions the callbacks of keyboard actions.
* @param imeAction the preferred IME action for the keyboard to have.
* @param textToolbarType The type of [TextToolbar] to use on the text field.
* @param textFieldTestTag The optional test tag associated with the inner text field.
* @param cardStyle Indicates the type of card style to be applied.
@@ -129,6 +131,7 @@ fun BitwardenTextField(
shouldAddCustomLineBreaks: Boolean = false,
keyboardType: KeyboardType = KeyboardType.Text,
keyboardActions: KeyboardActions = KeyboardActions.Default,
imeAction: ImeAction = ImeAction.Default,
isError: Boolean = false,
autoFocus: Boolean = false,
visualTransformation: VisualTransformation = VisualTransformation.None,
@@ -165,6 +168,7 @@ fun BitwardenTextField(
shouldAddCustomLineBreaks = shouldAddCustomLineBreaks,
keyboardType = keyboardType,
keyboardActions = keyboardActions,
imeAction = imeAction,
isError = isError,
autoFocus = autoFocus,
visualTransformation = visualTransformation,
@@ -204,6 +208,7 @@ fun BitwardenTextField(
* @param visualTransformation Transforms the visual representation of the input [value].
* @param keyboardType the preferred type of keyboard input.
* @param keyboardActions the callbacks of keyboard actions.
* @param imeAction the preferred IME action for the keyboard to have.
* @param textToolbarType The type of [TextToolbar] to use on the text field.
* @param textFieldTestTag The optional test tag associated with the inner text field.
* @param cardStyle Indicates the type of card style to be applied.
@@ -235,6 +240,7 @@ fun BitwardenTextField(
shouldAddCustomLineBreaks: Boolean = false,
keyboardType: KeyboardType = KeyboardType.Text,
keyboardActions: KeyboardActions = KeyboardActions.Default,
imeAction: ImeAction = ImeAction.Default,
isError: Boolean = false,
autoFocus: Boolean = false,
visualTransformation: VisualTransformation = VisualTransformation.None,
@@ -368,7 +374,10 @@ fun BitwardenTextField(
singleLine = singleLine,
readOnly = readOnly,
textStyle = textStyle,
keyboardOptions = KeyboardOptions.Default.copy(keyboardType = keyboardType),
keyboardOptions = KeyboardOptions.Default.copy(
keyboardType = keyboardType,
imeAction = imeAction,
),
keyboardActions = keyboardActions,
trailingIcon = actions?.let {
{