InputTextMultiline: Tabbing through a multi-line text editor using ImGuiInputTextFlags_AllowTabInput doesn't activate it. (#3092, #5759, #787)

This commit is contained in:
ocornut
2023-12-14 17:02:23 +01:00
parent 54c1bdeceb
commit 6cfe3ddf52
5 changed files with 11 additions and 2 deletions

View File

@ -4126,7 +4126,11 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
item_data_backup = g.LastItemData;
window->DC.CursorPos = backup_pos;
// Prevent NavActivate reactivating in BeginChild().
// Prevent NavActivation from Tabbing when our widget accepts Tab inputs: this allows cycling through widgets without stopping.
if (g.NavActivateId == id && (g.NavActivateFlags & ImGuiActivateFlags_FromTabbing) && (flags & ImGuiInputTextFlags_AllowTabInput))
g.NavActivateId = 0;
// Prevent NavActivate reactivating in BeginChild() when we are already active.
const ImGuiID backup_activate_id = g.NavActivateId;
if (g.ActiveId == id) // Prevent reactivation
g.NavActivateId = 0;