mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 14:53:01 +08:00
Fix race condition causing selection to be reset incorrectly
This commit is contained in:
parent
d6768bba62
commit
afd3e4604b
@ -1,7 +1,6 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System.Linq;
|
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
@ -38,11 +37,11 @@ namespace osu.Game.Screens.Multi
|
|||||||
((DrawableRoomPlaylistItem)newItem).Select();
|
((DrawableRoomPlaylistItem)newItem).Select();
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
Items.ItemsRemoved += items =>
|
Items.ItemsRemoved += items => Schedule(() =>
|
||||||
{
|
{
|
||||||
if (items.Any(i => i == SelectedItem.Value))
|
if (!Items.Contains(SelectedItem.Value))
|
||||||
SelectedItem.Value = null;
|
SelectedItem.Value = null;
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override ScrollContainer<Drawable> CreateScrollContainer() => base.CreateScrollContainer().With(d =>
|
protected override ScrollContainer<Drawable> CreateScrollContainer() => base.CreateScrollContainer().With(d =>
|
||||||
|
Loading…
Reference in New Issue
Block a user