Add emoji search to the reaction emoji picker (#5255)
* Add emoji search to the reaction emoji picker * Update screenshots * Fix tests and lint issues. Fixing the tests required addressing some underlying issues in `SearchBar` --------- Co-authored-by: ElementBot <android@element.io>
This commit is contained in:
parent
a2dd455f22
commit
bdb9acfd32
18 changed files with 395 additions and 121 deletions
|
|
@ -23,7 +23,10 @@ import androidx.compose.material3.TextFieldColors
|
|||
import androidx.compose.material3.TextFieldDefaults
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.Immutable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.rememberUpdatedState
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.Shape
|
||||
|
|
@ -67,16 +70,19 @@ fun <T> SearchBar(
|
|||
) {
|
||||
val focusManager = LocalFocusManager.current
|
||||
|
||||
if (!active) {
|
||||
onQueryChange("")
|
||||
focusManager.clearFocus()
|
||||
val updatedOnQueryChange by rememberUpdatedState(onQueryChange)
|
||||
LaunchedEffect(active) {
|
||||
if (!active) {
|
||||
updatedOnQueryChange("")
|
||||
focusManager.clearFocus()
|
||||
}
|
||||
}
|
||||
|
||||
SearchBar(
|
||||
inputField = {
|
||||
SearchBarDefaults.InputField(
|
||||
query = query,
|
||||
onQueryChange = onQueryChange,
|
||||
onQueryChange = updatedOnQueryChange,
|
||||
onSearch = { focusManager.clearFocus() },
|
||||
expanded = active,
|
||||
onExpandedChange = onActiveChange,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue