diff options
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/composable/ShortcutHelper.kt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/composable/ShortcutHelper.kt b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/composable/ShortcutHelper.kt index b2acc2ad7aba..3c8bb09ddc09 100644 --- a/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/composable/ShortcutHelper.kt +++ b/packages/SystemUI/src/com/android/systemui/keyboard/shortcut/ui/composable/ShortcutHelper.kt @@ -48,6 +48,7 @@ import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items +import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape @@ -434,11 +435,13 @@ private fun ShortcutHelperTwoPane( @Composable private fun EndSidePanel(searchQuery: String, modifier: Modifier, category: ShortcutCategory?) { + val listState = rememberLazyListState() + LaunchedEffect(key1 = category) { if (category != null) listState.animateScrollToItem(0) } if (category == null) { NoSearchResultsText(horizontalPadding = 24.dp, fillHeight = false) return } - LazyColumn(modifier = modifier) { + LazyColumn(modifier = modifier, state = listState) { items(category.subCategories) { subcategory -> SubCategoryContainerDualPane(searchQuery = searchQuery, subCategory = subcategory) Spacer(modifier = Modifier.height(8.dp)) |