From 9d0de2f386e85524d66be7c9bb3574785e998547 Mon Sep 17 00:00:00 2001 From: Anna Date: Sun, 10 Jul 2022 13:46:17 -0400 Subject: [PATCH] fix: use keyboard focus correctly --- ChatTwo/Ui/ChatLog.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ChatTwo/Ui/ChatLog.cs b/ChatTwo/Ui/ChatLog.cs index d56e8a5..3699d0a 100755 --- a/ChatTwo/Ui/ChatLog.cs +++ b/ChatTwo/Ui/ChatLog.cs @@ -433,10 +433,6 @@ internal sealed class ChatLog : IUiComponent { ? this.DrawTabSidebar() : this.DrawTabBar(); - if (this.Activate) { - ImGui.SetKeyboardFocusHere(); - } - Tab? activeTab = null; if (currentTab > -1 && currentTab < this.Ui.Plugin.Config.Tabs.Count) { activeTab = this.Ui.Plugin.Config.Tabs[currentTab]; @@ -545,6 +541,10 @@ internal sealed class ChatLog : IUiComponent { ImGui.PushStyleColor(ImGuiCol.Text, ColourUtil.RgbaToAbgr(inputColour.Value)); } + if (this.Activate) { + ImGui.SetKeyboardFocusHere(); + } + var chatCopy = this.Chat; ImGui.SetNextItemWidth(inputWidth); const ImGuiInputTextFlags inputFlags = ImGuiInputTextFlags.CallbackAlways @@ -1093,7 +1093,7 @@ internal sealed class ChatLog : IUiComponent { if (ImGui.IsWindowAppearing()) { this._fixCursor = true; - ImGui.SetKeyboardFocusHere(); + ImGui.SetKeyboardFocusHere(-1); } if (ImGui.BeginChild("##auto-complete-list", Vector2.Zero, false, ImGuiWindowFlags.HorizontalScrollbar)) {