diff --git a/imgui.cpp b/imgui.cpp index 8d5de35cb..cb5c8bf31 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -2224,6 +2224,7 @@ static void NavProcessItem(ImGuiWindow* window, const ImRect& nav_bb, const ImGu if (g.NavId == id) { window->NavRectRel[window->DC.NavLayerCurrent] = nav_bb_rel; + g.NavWindow = window; // Always refresh g.NavWindow, because some operations such as FocusItem() don't have a window. g.NavIdIsAlive = true; g.NavIdTabCounter = window->FocusIdxTabCounter; }