From 47c41483bd8936e7a58db25ebd5671ff98b3c32d Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 11 Aug 2025 10:47:55 +0200 Subject: [PATCH] Tables, Nav: fixed navigation within scrolling tables when item boundaries goes beyond columns limits. (#8816, #2221) Amend 00d3f9295e5caf417886572266bebb490ad3577b. --- docs/CHANGELOG.txt | 3 +++ imgui.cpp | 3 ++- imgui_tables.cpp | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 42b36e269..aa0b1db9e 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -81,6 +81,9 @@ Other Changes: - Tabs: fixed tab bar underline not drawing below scroll buttons, when they are enabled (minor regression from 1.90). (#6820, #4859, #5022, #5239) - Tabs: made scrolling buttons never keyboard/gamepad navigation candidates. +- Nav, Tables: fixed navigation within scrolling tables when item boundaries + goes beyond columns limits. The fix done in 1.89.6 didn't work correctly + on scrolling windows. (#8816, #2221) - Nav: fixed a bug where GamepadMenu button couldn't toggle between main and menu layers while navigating a Modal window. (#8834) - Error Handling: minor improvements to error handling for TableGetSortSpecs() diff --git a/imgui.cpp b/imgui.cpp index 4b2936d9c..6f9a77497 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -24,7 +24,7 @@ // For first-time users having issues compiling/linking/running: // please post in https://github.com/ocornut/imgui/discussions if you cannot find a solution in resources above. // Everything else should be asked in 'Issues'! We are building a database of cross-linked knowledge there. -// Since 1.92, we encourage font loading question to also be posted in 'Issues'. +// Since 1.92, we encourage font loading questions to also be posted in 'Issues'. // Copyright (c) 2014-2025 Omar Cornut // Developed by Omar Cornut and every direct or indirect contributors to the GitHub. @@ -13746,6 +13746,7 @@ void ImGui::NavUpdateCreateMoveRequest() } } + // Prepare scoring rectangle. // For scoring we use a single segment on the left side our current item bounding box (not touching the edge to avoid box overlap with zero-spaced items) ImRect scoring_rect; if (window != NULL) diff --git a/imgui_tables.cpp b/imgui_tables.cpp index a1504853b..2816707cf 100644 --- a/imgui_tables.cpp +++ b/imgui_tables.cpp @@ -542,7 +542,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG // Make table current g.CurrentTable = table; - outer_window->DC.NavIsScrollPushableX = false; // Shortcut for NavUpdateCurrentWindowIsScrollPushableX(); + inner_window->DC.NavIsScrollPushableX = false; // Shortcut for NavUpdateCurrentWindowIsScrollPushableX(); outer_window->DC.CurrentTableIdx = table_idx; if (inner_window != outer_window) // So EndChild() within the inner window can restore the table properly. inner_window->DC.CurrentTableIdx = table_idx;