Dinoy Raj 1 month ago committed by GitHub
commit a1b1117c9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -62,6 +62,7 @@ import androidx.compose.ui.input.key.Key
import androidx.compose.ui.input.key.key
import androidx.compose.ui.input.key.onKeyEvent
import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.platform.SoftwareKeyboardController
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.AnnotatedString
@ -447,11 +448,18 @@ private fun SearchToolbar(
onBackClick: () -> Unit,
modifier: Modifier = Modifier,
) {
val keyboardController = LocalSoftwareKeyboardController.current
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = modifier.fillMaxWidth(),
) {
IconButton(onClick = { onBackClick() }) {
IconButton(
onClick = {
keyboardController?.hide()
onBackClick()
},
) {
Icon(
imageVector = NiaIcons.ArrowBack,
contentDescription = stringResource(
@ -463,6 +471,7 @@ private fun SearchToolbar(
onSearchQueryChanged = onSearchQueryChanged,
onSearchTriggered = onSearchTriggered,
searchQuery = searchQuery,
keyboardController = keyboardController
)
}
}
@ -470,11 +479,11 @@ private fun SearchToolbar(
@Composable
private fun SearchTextField(
searchQuery: String,
keyboardController: SoftwareKeyboardController?,
onSearchQueryChanged: (String) -> Unit,
onSearchTriggered: (String) -> Unit,
) {
val focusRequester = remember { FocusRequester() }
val keyboardController = LocalSoftwareKeyboardController.current
val onSearchExplicitlyTriggered = {
keyboardController?.hide()

Loading…
Cancel
Save