Fix crash when suggestions have the same keyword

This commit is contained in:
FooIbar committed 2023-12-22 14:44:06 +08:00
1 parent 8aaad071ea
commit eeed56b211
1 file changed
+1 -1
@@ -332,7 +332,7 @@ fun SearchBarScreen(
contentPadding = WindowInsets.navigationBars.union(WindowInsets.ime)
.only(WindowInsetsSides.Bottom).asPaddingValues(),
) {
items(mSuggestionList, key = { it.keyword }) {
items(mSuggestionList, key = { it.keyword.hashCode() * 31 + it.hint.hashCode() }) {
ListItem(
headlineContent = { Text(text = it.keyword) },
supportingContent = it.hint.ifNotNullThen { Text(text = it.hint!!) },