diff --git a/Content.Client/Labels/UI/HandLabelerWindow.xaml.cs b/Content.Client/Labels/UI/HandLabelerWindow.xaml.cs index 7a0627b3e2..528e227f55 100644 --- a/Content.Client/Labels/UI/HandLabelerWindow.xaml.cs +++ b/Content.Client/Labels/UI/HandLabelerWindow.xaml.cs @@ -33,8 +33,13 @@ namespace Content.Client.Labels.UI _focused = false; LabelLineEdit.Text = _label; }; + } - // Give the editor keybard focus, since that's the only + protected override void Opened() + { + base.Opened(); + + // Give the editor keyboard focus, since that's the only // thing the user will want to be doing with this UI LabelLineEdit.GrabKeyboardFocus(); } diff --git a/Content.Client/UserInterface/Controls/DialogWindow.xaml.cs b/Content.Client/UserInterface/Controls/DialogWindow.xaml.cs index 733dbe3265..d831f60247 100644 --- a/Content.Client/UserInterface/Controls/DialogWindow.xaml.cs +++ b/Content.Client/UserInterface/Controls/DialogWindow.xaml.cs @@ -87,9 +87,6 @@ public sealed partial class DialogWindow : FancyWindow Prompts.AddChild(box); } - // Grab keyboard focus for the first dialog entry - _promptLines[0].Item2.GrabKeyboardFocus(); - OkButton.OnPressed += _ => Confirm(); CancelButton.OnPressed += _ => @@ -110,6 +107,14 @@ public sealed partial class DialogWindow : FancyWindow OpenCentered(); } + protected override void Opened() + { + base.Opened(); + + // Grab keyboard focus for the first dialog entry + _promptLines[0].Item2.GrabKeyboardFocus(); + } + private void Confirm() { var results = new Dictionary();