]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
HOTFIX: Fix lineedit focus (#34621)
authorShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
Thu, 6 Feb 2025 15:14:55 +0000 (07:14 -0800)
committerGitHub <noreply@github.com>
Thu, 6 Feb 2025 15:14:55 +0000 (16:14 +0100)
* Test entered tree fix

* Use Opened override

* Fix keyboard focus on window open for DialogWindow

This affects Phone, Pray, Rename, and multiple other admin verbs.

* Clean up

Content.Client/Labels/UI/HandLabelerWindow.xaml.cs
Content.Client/UserInterface/Controls/DialogWindow.xaml.cs

index 7a0627b3e236e90125b71ed526f25c4d11f3678f..528e227f552a7fc8e9e43000651985d686f230ad 100644 (file)
@@ -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();
         }
index 733dbe326583a82d4b9a7236374b07be1fdb2e6d..d831f60247740dbeb476fe27ee32795c079d7e3c 100644 (file)
@@ -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<string, string>();