Refine chat input focus behavior

This commit is contained in:
Kelsi 2026-02-07 19:08:16 -08:00
parent 8bdf0a2e79
commit 866877cad0

View file

@ -402,11 +402,6 @@ void GameScreen::renderChatWindow(game::GameHandler& gameHandler) {
chatWindowPos_ = ImGui::GetWindowPos();
}
// Click anywhere in chat window → focus the input field
if (ImGui::IsWindowHovered(ImGuiHoveredFlags_ChildWindows) && ImGui::IsMouseClicked(0)) {
refocusChatInput = true;
}
// Chat history
const auto& chatHistory = gameHandler.getChatHistory();
@ -440,6 +435,11 @@ void GameScreen::renderChatWindow(game::GameHandler& gameHandler) {
ImGui::EndChild();
// Click on chat history area → focus the input field
if (ImGui::IsItemClicked()) {
refocusChatInput = true;
}
ImGui::Spacing();
ImGui::Separator();
ImGui::Spacing();