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:
Jorge Martin Espinosa 2025-09-05 19:11:40 +02:00 committed by GitHub
parent a2dd455f22
commit bdb9acfd32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 395 additions and 121 deletions

View file

@ -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,