Skip to content

Commit

Permalink
[Jetcaster] update search bar text as you type (#1462)
Browse files Browse the repository at this point in the history
Fixes part of #1461
  • Loading branch information
jdkoren authored Oct 15, 2024
2 parents bc2f4f1 + c2b7327 commit 7d350ae
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ import androidx.compose.material3.adaptive.separatingVerticalHingeBounds
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.runtime.snapshotFlow
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand Down Expand Up @@ -379,18 +381,21 @@ private fun HomeAppBar(
isExpanded: Boolean,
modifier: Modifier = Modifier,
) {
var queryText by remember {
mutableStateOf("")
}
Row(
horizontalArrangement = Arrangement.End,
modifier = modifier
.fillMaxWidth()
.background(Color.Transparent)
.padding(end = 16.dp, top = 8.dp, bottom = 8.dp, start = 16.dp)
.padding(horizontal = 16.dp, vertical = 8.dp)
) {
SearchBar(
inputField = {
SearchBarDefaults.InputField(
query = "",
onQueryChange = {},
query = queryText,
onQueryChange = { queryText = it },
onSearch = {},
expanded = false,
onExpandedChange = {},
Expand Down

0 comments on commit 7d350ae

Please sign in to comment.