diff --git a/osu.Game/Graphics/Carousel/Carousel.cs b/osu.Game/Graphics/Carousel/Carousel.cs index c96afacd59..414aba1a2e 100644 --- a/osu.Game/Graphics/Carousel/Carousel.cs +++ b/osu.Game/Graphics/Carousel/Carousel.cs @@ -113,14 +113,21 @@ namespace osu.Game.Graphics.Carousel if (currentSelection.Model != null) HandleItemDeselected(currentSelection.Model); - currentKeyboardSelection = new Selection(value); - currentSelection = currentKeyboardSelection; + currentSelection = new Selection(value); + currentKeyboardSelection = currentSelection; selectionValid.Invalidate(); } - else if (currentKeyboardSelection.Model != value) + + // Check keyboard selection equality separately. + // + // If current selection set to an already-selected value, we want to ensure + // that keyboard selection (which basically represents the "visual" tracking of selection) + // is still reset back to the newly set value. + // + // The main case this handles is when a set header is clicked and we want to make sure one of its + // "children" are re-selected. + if (!CheckModelEquality(currentKeyboardSelection.Model, value)) { - // Even if the current selection matches, let's ensure the keyboard selection is reset - // to the newly selected object. This matches user expectations (for now). currentKeyboardSelection = currentSelection; selectionValid.Invalidate(); }