mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 14:32:55 +08:00
Kill search focus when clicking on ModColumn
This commit is contained in:
parent
ca68850730
commit
6647d95ea7
@ -468,6 +468,24 @@ namespace osu.Game.Tests.Visual.UserInterface
|
||||
AddAssert("unimplemented mod panel is filtered", () => !getPanelForMod(typeof(TestUnimplementedMod)).IsValid);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSearchFocusChange()
|
||||
{
|
||||
createScreen();
|
||||
|
||||
AddStep("click on search", navigateAndClick<ShearedSearchTextBox>);
|
||||
AddAssert("focused", () => modSelectOverlay.SearchTextBox.HasFocus);
|
||||
|
||||
AddStep("click on mod column", navigateAndClick<ModColumn>);
|
||||
AddAssert("lost focus", () => !modSelectOverlay.SearchTextBox.HasFocus);
|
||||
|
||||
void navigateAndClick<T>() where T : Drawable
|
||||
{
|
||||
InputManager.MoveMouseTo(modSelectOverlay.ChildrenOfType<T>().FirstOrDefault());
|
||||
InputManager.Click(MouseButton.Left);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestDeselectAllViaKey()
|
||||
{
|
||||
|
@ -777,6 +777,9 @@ namespace osu.Game.Overlays.Mods
|
||||
if (!Active.Value)
|
||||
RequestScroll?.Invoke(this);
|
||||
|
||||
//Kill focus on SearchTextBox
|
||||
Scheduler.Add(() => GetContainingInputManager().ChangeFocus(null));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user