-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
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
IsWindowAppearing + SetKeyboardFocusHere not focusing keyboard on first open #4079
Comments
Please specify which exact version because we made changes to those functions recently. |
Thank you for confirming this. I think this is the same as #343. I'm going to look at this now. |
…le it prior to clipping (not yet the case) (#343, #4079) Now performed in ItemAdd(). It can't be trivially moved above clipping effectively because it would require us to scroll to be useful, meaning we'd be better off locking the bounding box a frame earlier. Still wip. As-is this commit has no value for end-user, but it's a reengineering that moves us closer to the solution. + Internals: moved internal flags.
Having investigated I believe this statement may be incorrect, I also know understand how subtle factors can invalidate some tests you could have done. Since this is a clipping issue, last known window size would affect it, and e.g not using Actually spent a while digging on this but it is a rather nasty problem to fully solve (had a bunch of related work done a while ago, almost spent a week on this but didn't finish). I would want to solve it. I just committed some partial refactor (393941c) which is getting us closer to being able to move the focusable registration before clipping, as it is now performed in ...However they can't be trivially swapped yet because it would require us to scroll to keep target item visible in order to be useful (if you Tab out of sight it would be wrong). So while doing that simple swap would fix #4079 and #343 it would currently come with a bigger regression in term of user experience. Given the current code we have access to the positional data too late in the frame since scroll needs to be locked in So right now I don't have a nice answer for it but
Repro ImGui::Begin("Another Window", &show_another_window, ImGuiWindowFlags_AlwaysAutoResize); // Pass a pointer to our bool variable (the window will have a closing button that will clear the bool when clicked)
static char query[256] = "";
ImGui::Text("Search for file:");
if (ImGui::IsWindowAppearing())
ImGui::SetKeyboardFocusHere();
ImGui::InputText("##search_for_file", query, 256);
ImGui::Text("Hello from another window!");
if (ImGui::Button("Close Me"))
show_another_window = false;
ImGui::End(); |
Better late than never.... using (I'm not done with the refactor as Tabbing currently doesn't scroll, I still have a few things I don't yet know how to solve for the tabbing but we are nearly there). |
No description provided.
The text was updated successfully, but these errors were encountered: