diff --git a/osu.Game/Graphics/Containers/SectionsContainer.cs b/osu.Game/Graphics/Containers/SectionsContainer.cs index cd6d0a9432..76492cab55 100644 --- a/osu.Game/Graphics/Containers/SectionsContainer.cs +++ b/osu.Game/Graphics/Containers/SectionsContainer.cs @@ -202,8 +202,6 @@ protected void InvalidateScrollPosition() }); } - private int lastKnownChildrenCount; - protected override void UpdateAfterChildren() { base.UpdateAfterChildren(); @@ -222,12 +220,10 @@ protected override void UpdateAfterChildren() } float currentScroll = scrollContainer.Current; - var presentChildren = Children.Where(c => c.IsPresent); - if (currentScroll != lastKnownScroll || presentChildren.Count() != lastKnownChildrenCount) + if (currentScroll != lastKnownScroll) { lastKnownScroll = currentScroll; - lastKnownChildrenCount = presentChildren.Count(); // reset last clicked section because user started scrolling themselves if (scrollContainer.UserScrolling) @@ -253,6 +249,8 @@ protected override void UpdateAfterChildren() float scrollCentre = fixedHeaderSize + scrollContainer.DisplayableContent * scroll_y_centre + selectionLenienceAboveSection; + var presentChildren = Children.Where(c => c.IsPresent); + if (lastClickedSection != null) SelectedSection.Value = lastClickedSection; else if (Precision.AlmostBigger(0, scrollContainer.Current)) diff --git a/osu.Game/Overlays/SettingsPanel.cs b/osu.Game/Overlays/SettingsPanel.cs index e4e76592d8..5589786169 100644 --- a/osu.Game/Overlays/SettingsPanel.cs +++ b/osu.Game/Overlays/SettingsPanel.cs @@ -211,7 +211,7 @@ private void loadSections() loading.Hide(); - searchTextBox.Current.BindValueChanged(term => SectionsContainer.SearchContainer.SearchTerm = term.NewValue, true); + searchTextBox.Current.BindValueChanged(term => SectionsContainer.SearchTerm = term.NewValue, true); searchTextBox.TakeFocus(); loadSidebarButtons();