Add workaround for item scrolling issue

This commit is contained in:
Salman Ahmed
2022-05-05 10:16:16 +03:00
parent a26793cd65
commit ac6342ff8d

View File

@ -190,7 +190,12 @@ namespace osu.Game.Screens.OnlinePlay
if (SelectedItem.Value == null || !ItemMap.TryGetValue(SelectedItem.Value, out var drawableItem)) if (SelectedItem.Value == null || !ItemMap.TryGetValue(SelectedItem.Value, out var drawableItem))
return; return;
ScrollContainer.ScrollIntoView(drawableItem); // ScrollIntoView does not handle non-loaded items appropriately, delay scroll until the item finishes loading.
// see: https://github.com/ppy/osu-framework/issues/5158
if (!drawableItem.IsLoaded)
drawableItem.OnLoadComplete += _ => ScrollContainer.ScrollIntoView(drawableItem);
else
ScrollContainer.ScrollIntoView(drawableItem);
} }
#region Key selection logic (shared with BeatmapCarousel and RoomsContainer) #region Key selection logic (shared with BeatmapCarousel and RoomsContainer)