You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apologies in advance if I did something wrong, or this has been posted. I did look but I couldn't find anything myself.
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
// Here's some code anyone can copy and paste to reproduce your issueImGui::Begin("InputText Bug: Empty label unfocus");
char coolTextField[32];
ImGui::InputText("", coolTextField, sizeof(coolTextField));
ImGui::End();
The text was updated successfully, but these errors were encountered:
In addition, and this is VERY IMPORTANT.
We DO detect this case and assert against it.
If I try to run your code I get this message:
That you didn't get the message means your asserts are not working or disabled. It is going to be really problematic using Dear ImGui if you don't have asserts enabled.
Version/Branch of Dear ImGui:
Version 1.90.1, Branch: master
Back-ends:
imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp
Compiler, OS:
Arch Linux + G++
Full config/build information:
No response
Details:
If you pass in an empty string into the first argument of ImGui::InputText whenever it gets rendered it will unfocus, and you cannot type anything.
ImGui::InputText("", coolTextField, sizeof(coolTextField);
Everything compiles completely fine, you only see the issue once you run the compiled binary.
It can be an annoyance if you don't want any text to display next to the box, my hacky workaround was to pass in a "\t" like so:
ImGui::InputText("\t", coolTextField, sizeof(coolTextField));
Apologies in advance if I did something wrong, or this has been posted. I did look but I couldn't find anything myself.
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
The text was updated successfully, but these errors were encountered: