From 1bb24c923dca4943e7d19cdd0ffde9959896500d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Fri, 29 Aug 2025 12:23:51 +0200 Subject: [PATCH] Fix stale group refresh logic inadvertently losing selection entirely sometimes --- osu.Game/Screens/SelectV2/BeatmapCarousel.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/SelectV2/BeatmapCarousel.cs b/osu.Game/Screens/SelectV2/BeatmapCarousel.cs index 55751718b1..b5f2a3aa25 100644 --- a/osu.Game/Screens/SelectV2/BeatmapCarousel.cs +++ b/osu.Game/Screens/SelectV2/BeatmapCarousel.cs @@ -451,7 +451,10 @@ namespace osu.Game.Screens.SelectV2 { // If the group no longer exists, grab an arbitrary other instance of the beatmap under the first group encountered. var newSelection = GetCarouselItems()?.Select(i => i.Model).OfType().FirstOrDefault(gb => gb.Beatmap.Equals(currentGroupedBeatmap.Beatmap)); - CurrentSelection = newSelection; + // Only change the selection if we actually got a positive hit. + // This is necessary so that selection isn't lost if the panel reappears later due to e.g. unapplying some filter criteria that made it disappear in the first place. + if (newSelection != null) + CurrentSelection = newSelection; } // If a group was selected that is not the one containing the selection, attempt to reselect it.