Fix osu! dropdown search text box having commits disabled

I've also removed inheritance from `SearchTextBox` because it contains
logic that might interfere with the internal implementation of dropdown
search bars (focus logic and stuff).
This commit is contained in:
Salman Ahmed 2024-06-27 07:09:46 +03:00
parent e4335a543e
commit 811621325f

View File

@ -418,16 +418,19 @@ namespace osu.Game.Graphics.UserInterface
FontSize = OsuFont.Default.Size, FontSize = OsuFont.Default.Size,
}; };
private partial class DropdownSearchTextBox : SearchTextBox private partial class DropdownSearchTextBox : OsuTextBox
{ {
public override bool OnPressed(KeyBindingPressEvent<GlobalAction> e) [BackgroundDependencyLoader]
private void load(OverlayColourProvider? colourProvider)
{ {
if (e.Action == GlobalAction.Back) BackgroundUnfocused = colourProvider?.Background5 ?? new Color4(10, 10, 10, 255);
// this method is blocking Dropdown from receiving the back action, despite this text box residing in a separate input manager. BackgroundFocused = colourProvider?.Background5 ?? new Color4(10, 10, 10, 255);
// to fix this properly, a local global action container needs to be added as well, but for simplicity, just don't handle the back action here. }
return false;
return base.OnPressed(e); protected override void OnFocus(FocusEvent e)
{
base.OnFocus(e);
BorderThickness = 0;
} }
} }
} }