mirror of
https://github.com/ppy/osu
synced 2025-02-04 20:32:12 +00:00
Fix LabelledTextBox not correctly forwarding focus to its underlying TextBox component
This commit is contained in:
parent
eda891223c
commit
26d6f96c4e
@ -5,6 +5,7 @@ using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterfaceV2
|
||||
@ -53,6 +54,14 @@ namespace osu.Game.Graphics.UserInterfaceV2
|
||||
CornerRadius = CORNER_RADIUS,
|
||||
};
|
||||
|
||||
public override bool AcceptsFocus => true;
|
||||
|
||||
protected override void OnFocus(FocusEvent e)
|
||||
{
|
||||
base.OnFocus(e);
|
||||
GetContainingInputManager().ChangeFocus(Component);
|
||||
}
|
||||
|
||||
protected override OsuTextBox CreateComponent() => CreateTextBox().With(t =>
|
||||
{
|
||||
t.OnCommit += (sender, newText) => OnCommit?.Invoke(sender, newText);
|
||||
|
Loading…
Reference in New Issue
Block a user