mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Clear search text when navigating back
This commit is contained in:
parent
1610ae4930
commit
f3019b0a6e
2 changed files with 8 additions and 19 deletions
|
|
@ -73,7 +73,7 @@ fun SearchField(
|
|||
val keyboardController = LocalSoftwareKeyboardController.current
|
||||
val focusRequester = remember { FocusRequester() }
|
||||
|
||||
TextField(
|
||||
TextField(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
// .padding(vertical = 2.dp)
|
||||
|
|
@ -86,16 +86,18 @@ fun SearchField(
|
|||
placeholder = {
|
||||
Text(text = "Search")
|
||||
},
|
||||
leadingIcon = {
|
||||
IconButton(
|
||||
onClick = { navController.popBackStack() }
|
||||
) {
|
||||
leadingIcon = {
|
||||
IconButton(
|
||||
onClick = {
|
||||
onSearchTextChanged("")
|
||||
navController.popBackStack()
|
||||
}) {
|
||||
Icon(
|
||||
imageVector = androidx.compose.material.icons.Icons.Filled.ArrowBack,
|
||||
contentDescription = "Back"
|
||||
)
|
||||
}
|
||||
},
|
||||
},
|
||||
trailingIcon = {
|
||||
AnimatedVisibility(
|
||||
visible = showClearButton,
|
||||
|
|
|
|||
|
|
@ -45,19 +45,6 @@ fun SearchView(
|
|||
topBar = {
|
||||
TopAppBar(
|
||||
title = { Text("") },
|
||||
// SearchField(searchText) { libraryViewModel.updateSearchText(it) }
|
||||
// },
|
||||
// navigationIcon = {
|
||||
// IconButton(
|
||||
// modifier = Modifier.background(color = Color.Red),
|
||||
// onClick = { navController.popBackStack() }
|
||||
// ) {
|
||||
// Icon(
|
||||
// imageVector = androidx.compose.material.icons.Icons.Filled.ArrowBack,
|
||||
// contentDescription = "Back"
|
||||
// )
|
||||
// },
|
||||
|
||||
actions = {
|
||||
Row {
|
||||
SearchField(
|
||||
|
|
|
|||
Loading…
Reference in a new issue