Remember selected index when returning from cheat category

This commit is contained in:
Gericom
2026-03-01 16:24:05 +01:00
parent e2e42115e7
commit 10431c4615
3 changed files with 17 additions and 8 deletions

View File

@@ -175,8 +175,9 @@ bool CheatsBottomSheetView::HandleInput(const InputProvider& inputProvider, Focu
void CheatsBottomSheetView::UpdateCheatList()
{
auto oldAdapter = _cheatsAdapter;
_cheatsAdapter = new CheatsAdapter(_viewModel->GetCurrentCheatCategory(), _materialColorScheme, _fontRepository, _vramOffsets);
_cheatListRecycler->SetAdapter(_cheatsAdapter);
_cheatsAdapter = new CheatsAdapter(
_viewModel->GetCurrentCheatCategory(), _materialColorScheme, _fontRepository, _vramOffsets);
_cheatListRecycler->SetAdapter(_cheatsAdapter, _viewModel->GetSelectedItem());
delete oldAdapter;
// Ugly hack