Skip to content

Commit 30ce512

Browse files
PM-29442: Change 2fa field to not be a password field (#6269)
1 parent bdbcd5b commit 30ce512

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

app/src/main/kotlin/com/x8bit/bitwarden/ui/auth/feature/twofactorlogin/TwoFactorLoginScreen.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import com.bitwarden.ui.platform.components.button.BitwardenFilledButton
4141
import com.bitwarden.ui.platform.components.button.BitwardenOutlinedButton
4242
import com.bitwarden.ui.platform.components.dialog.BitwardenBasicDialog
4343
import com.bitwarden.ui.platform.components.dialog.BitwardenLoadingDialog
44-
import com.bitwarden.ui.platform.components.field.BitwardenPasswordField
44+
import com.bitwarden.ui.platform.components.field.BitwardenTextField
4545
import com.bitwarden.ui.platform.components.model.CardStyle
4646
import com.bitwarden.ui.platform.components.scaffold.BitwardenScaffold
4747
import com.bitwarden.ui.platform.components.snackbar.BitwardenSnackbarHost
@@ -263,7 +263,7 @@ private fun TwoFactorLoginScreenContent(
263263

264264
Spacer(modifier = Modifier.height(12.dp))
265265
if (state.shouldShowCodeInput) {
266-
BitwardenPasswordField(
266+
BitwardenTextField(
267267
value = state.codeInput,
268268
onValueChange = onCodeInputChange,
269269
label = stringResource(id = BitwardenString.verification_code),

ui/src/main/kotlin/com/bitwarden/ui/platform/components/field/BitwardenTextField.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import androidx.compose.ui.semantics.customActions
4848
import androidx.compose.ui.semantics.semantics
4949
import androidx.compose.ui.text.TextRange
5050
import androidx.compose.ui.text.TextStyle
51+
import androidx.compose.ui.text.input.ImeAction
5152
import androidx.compose.ui.text.input.KeyboardType
5253
import androidx.compose.ui.text.input.TextFieldValue
5354
import androidx.compose.ui.text.input.VisualTransformation
@@ -101,6 +102,7 @@ import kotlinx.collections.immutable.toImmutableList
101102
* @param visualTransformation Transforms the visual representation of the input [value].
102103
* @param keyboardType the preferred type of keyboard input.
103104
* @param keyboardActions the callbacks of keyboard actions.
105+
* @param imeAction the preferred IME action for the keyboard to have.
104106
* @param textToolbarType The type of [TextToolbar] to use on the text field.
105107
* @param textFieldTestTag The optional test tag associated with the inner text field.
106108
* @param cardStyle Indicates the type of card style to be applied.
@@ -129,6 +131,7 @@ fun BitwardenTextField(
129131
shouldAddCustomLineBreaks: Boolean = false,
130132
keyboardType: KeyboardType = KeyboardType.Text,
131133
keyboardActions: KeyboardActions = KeyboardActions.Default,
134+
imeAction: ImeAction = ImeAction.Default,
132135
isError: Boolean = false,
133136
autoFocus: Boolean = false,
134137
visualTransformation: VisualTransformation = VisualTransformation.None,
@@ -165,6 +168,7 @@ fun BitwardenTextField(
165168
shouldAddCustomLineBreaks = shouldAddCustomLineBreaks,
166169
keyboardType = keyboardType,
167170
keyboardActions = keyboardActions,
171+
imeAction = imeAction,
168172
isError = isError,
169173
autoFocus = autoFocus,
170174
visualTransformation = visualTransformation,
@@ -204,6 +208,7 @@ fun BitwardenTextField(
204208
* @param visualTransformation Transforms the visual representation of the input [value].
205209
* @param keyboardType the preferred type of keyboard input.
206210
* @param keyboardActions the callbacks of keyboard actions.
211+
* @param imeAction the preferred IME action for the keyboard to have.
207212
* @param textToolbarType The type of [TextToolbar] to use on the text field.
208213
* @param textFieldTestTag The optional test tag associated with the inner text field.
209214
* @param cardStyle Indicates the type of card style to be applied.
@@ -235,6 +240,7 @@ fun BitwardenTextField(
235240
shouldAddCustomLineBreaks: Boolean = false,
236241
keyboardType: KeyboardType = KeyboardType.Text,
237242
keyboardActions: KeyboardActions = KeyboardActions.Default,
243+
imeAction: ImeAction = ImeAction.Default,
238244
isError: Boolean = false,
239245
autoFocus: Boolean = false,
240246
visualTransformation: VisualTransformation = VisualTransformation.None,
@@ -368,7 +374,10 @@ fun BitwardenTextField(
368374
singleLine = singleLine,
369375
readOnly = readOnly,
370376
textStyle = textStyle,
371-
keyboardOptions = KeyboardOptions.Default.copy(keyboardType = keyboardType),
377+
keyboardOptions = KeyboardOptions.Default.copy(
378+
keyboardType = keyboardType,
379+
imeAction = imeAction,
380+
),
372381
keyboardActions = keyboardActions,
373382
trailingIcon = actions?.let {
374383
{

0 commit comments

Comments
 (0)