[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.performClick
import androidx.compose.ui.test.performScrollTo import androidx.compose.ui.test.performScrollTo
import androidx.compose.ui.test.performTextInput import androidx.compose.ui.test.performTextInput
import androidx.compose.ui.test.performTextReplacement
import androidx.compose.ui.test.performTouchInput import androidx.compose.ui.test.performTouchInput
import androidx.compose.ui.test.swipeRight import androidx.compose.ui.test.swipeRight
import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.text.AnnotatedString
@ -973,7 +974,7 @@ class GeneratorScreenTest : BitwardenComposeTest() {
composeTestRule composeTestRule
.onNodeWithText("Word separator") .onNodeWithText("Word separator")
.performScrollTo() .performScrollTo()
.performTextInput("a") .performTextReplacement("a")
verify { verify {
viewModel.trySendAction( viewModel.trySendAction(

View File

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