[PM-27869] fix/[PM-26241] : draw out keyboard on talkback click (#6129)

This commit is contained in:
Dev Sharma 2025-11-19 00:21:15 +05:30 committed by GitHub
parent d81b0005ee
commit 621f97d161
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 4 deletions

View File

@ -25,6 +25,7 @@ import androidx.compose.ui.test.onSiblings
import androidx.compose.ui.test.performClick
import androidx.compose.ui.test.performScrollTo
import androidx.compose.ui.test.performTextInput
import androidx.compose.ui.test.performTextReplacement
import androidx.compose.ui.test.performTouchInput
import androidx.compose.ui.test.swipeRight
import androidx.compose.ui.text.AnnotatedString
@ -973,7 +974,7 @@ class GeneratorScreenTest : BitwardenComposeTest() {
composeTestRule
.onNodeWithText("Word separator")
.performScrollTo()
.performTextInput("a")
.performTextReplacement("a")
verify {
viewModel.trySendAction(

View File

@ -1266,7 +1266,7 @@ class VaultAddEditScreenTest : BitwardenComposeTest() {
verify {
viewModel.trySendAction(
VaultAddEditAction.ItemType.LoginType.UriValueChange(
UriItem(id = "TestId", uri = "TestURI", match = null, checksum = null),
UriItem(id = "TestId", uri = "URITest", match = null, checksum = null),
),
)
}

View File

@ -45,6 +45,7 @@ import androidx.compose.ui.platform.TextToolbar
import androidx.compose.ui.semantics.CustomAccessibilityAction
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.KeyboardType
import androidx.compose.ui.text.input.TextFieldValue
@ -278,14 +279,16 @@ fun BitwardenTextField(
val isDropDownExpanded = filteredAutoCompleteList.isNotEmpty() && hasFocused
ExposedDropdownMenuBox(
expanded = isDropDownExpanded,
onExpandedChange = { hasFocused = false },
onExpandedChange = {
hasFocused = !hasFocused
focusRequester.requestFocus()
},
modifier = modifier.defaultMinSize(minHeight = 60.dp),
) {
Column(
modifier = Modifier
.onGloballyPositioned { widthPx = it.size.width }
.onFocusEvent { focusState -> hasFocused = focusState.hasFocus }
.focusRequester(focusRequester)
.cardStyle(
cardStyle = cardStyle,
paddingTop = 6.dp,
@ -377,8 +380,14 @@ fun BitwardenTextField(
.nullableTestTag(tag = textFieldTestTag)
.menuAnchor(type = ExposedDropdownMenuAnchorType.PrimaryEditable)
.fillMaxWidth()
.focusRequester(focusRequester)
.onFocusChanged { focusState ->
focused = focusState.isFocused
if (focused) {
textFieldValueState = textFieldValueState.copy(
selection = TextRange(textFieldValueState.text.length),
)
}
},
)
supportingContent