We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 1.91.1 WIP and 1.90.4, Branch: docking and master
imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp
Linux + GCC
No response
My Issue/Question:
As per issue 4761, SetKeyboardFocusHere looks like it doesn't work correctly with InputTextMultiline:
SetKeyboardFocusHere
InputTextMultiline
static char buffer[16]; bool reclaim_focus {false}; const auto flags {ImGuiInputTextFlags_CtrlEnterForNewLine | ImGuiInputTextFlags_EnterReturnsTrue}; if (ImGui::InputTextMultiline("##", buffer, sizeof(buffer), {}, flags)) { reclaim_focus = true; } if (reclaim_focus) { ImGui::SetKeyboardFocusHere(-1); }
Pressing enter still makes the input text box loose focus.
But with InputText it works:
InputText
static char buffer[16]; bool reclaim_focus {false}; const auto flags {ImGuiInputTextFlags_CtrlEnterForNewLine | ImGuiInputTextFlags_EnterReturnsTrue}; if (ImGui::InputText("##", buffer, sizeof(buffer), flags)) { reclaim_focus = true; } if (reclaim_focus) { ImGui::SetKeyboardFocusHere(-1); }
It looks like resetting the focus every frame works (sets the focus), but it's undesirable:
static char buffer[16]; const auto flags {ImGuiInputTextFlags_CtrlEnterForNewLine | ImGuiInputTextFlags_EnterReturnsTrue}; ImGui::InputTextMultiline("##", buffer, sizeof(buffer), flags); ImGui::SetKeyboardFocusHere(-1);
// Here's some code anyone can copy and paste to reproduce your issue ImGui::Begin("Example Bug"); // Sorry, the code snippets are above ImGui::End();
The text was updated successfully, but these errors were encountered:
InputText: fixed an issue programmatically refocusing a multi-line in…
521f84a
…put which was just active. (#4761, #7870) Amend 66f0fb9, c5db276
TestSuite: added "widgets_inputtext_multiline_refocus"
633988e
ocornut/imgui#4761 ocornut/imgui#7870
Fixed again 521f84a + extra test ocornut/imgui_test_engine@633988e
Sorry, something went wrong.
No branches or pull requests
Version/Branch of Dear ImGui:
Version 1.91.1 WIP and 1.90.4, Branch: docking and master
Back-ends:
imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp
Compiler, OS:
Linux + GCC
Full config/build information:
No response
Details:
My Issue/Question:
As per issue 4761,
SetKeyboardFocusHere
looks like it doesn't work correctly withInputTextMultiline
:Pressing enter still makes the input text box loose focus.
But with
InputText
it works:It looks like resetting the focus every frame works (sets the focus), but it's undesirable:
Screenshots/Video:
2024-08-07_22-19-55.mp4
Minimal, Complete and Verifiable Example code:
The text was updated successfully, but these errors were encountered: