Fix tabbing in/out of an InputTextMultiline(), broken by 6b8a059.
diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp
index 9716db6..9b84a3c 100644
--- a/imgui_widgets.cpp
+++ b/imgui_widgets.cpp
@@ -3966,6 +3966,7 @@
ImGuiWindow* draw_window = window;
ImVec2 inner_size = frame_size;
+ ImGuiItemStatusFlags item_status_flags = 0;
if (is_multiline)
{
if (!ItemAdd(total_bb, id, &frame_bb, ImGuiItemAddFlags_Focusable))
@@ -3974,6 +3975,7 @@
EndGroup();
return false;
}
+ item_status_flags = g.LastItemData.StatusFlags;
// We reproduce the contents of BeginChildFrame() in order to provide 'label' so our window internal data are easier to read/debug.
PushStyleColor(ImGuiCol_ChildBg, style.Colors[ImGuiCol_FrameBg]);
@@ -4000,6 +4002,7 @@
if (!(flags & ImGuiInputTextFlags_MergedItem))
if (!ItemAdd(total_bb, id, &frame_bb, ImGuiItemAddFlags_Focusable))
return false;
+ item_status_flags = g.LastItemData.StatusFlags;
}
const bool hovered = ItemHoverable(frame_bb, id);
if (hovered)
@@ -4008,8 +4011,8 @@
// We are only allowed to access the state if we are already the active widget.
ImGuiInputTextState* state = GetInputTextState(id);
- const bool focus_requested_by_code = (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_FocusedByCode) != 0;
- const bool focus_requested_by_tabbing = (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_FocusedByTabbing) != 0;
+ const bool focus_requested_by_code = (item_status_flags & ImGuiItemStatusFlags_FocusedByCode) != 0;
+ const bool focus_requested_by_tabbing = (item_status_flags & ImGuiItemStatusFlags_FocusedByTabbing) != 0;
const bool user_clicked = hovered && io.MouseClicked[0];
const bool user_nav_input_start = (g.ActiveId != id) && ((g.NavInputId == id) || (g.NavActivateId == id && g.NavInputSource == ImGuiInputSource_Keyboard));