From 45866bea4767e2855493c02e1b84f1506cd5547c Mon Sep 17 00:00:00 2001 From: ocornut Date: Thu, 2 Apr 2026 18:57:50 +0200 Subject: [PATCH] Tables: fixes not releasing ReorderColumn caused by 38f5e5a. Which could break clicking on header to sort. (#9312) --- imgui_tables.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/imgui_tables.cpp b/imgui_tables.cpp index 06b1742ca..28d8b6e39 100644 --- a/imgui_tables.cpp +++ b/imgui_tables.cpp @@ -699,7 +699,7 @@ void ImGui::TableBeginApplyRequests(ImGuiTable* table) } // Handle reordering request - // Note: we don't clear ReorderColumn after handling the request (FIXME: clarify why or add a test). + //// Note: we don't clear ReorderColumn after handling the request (FIXME: clarify why or add a test). if (table->InstanceCurrent == 0) { table->LastHeldHeaderColumn = table->HeldHeaderColumn; @@ -709,6 +709,13 @@ void ImGui::TableBeginApplyRequests(ImGuiTable* table) TableSetColumnDisplayOrder(table, table->ReorderColumn, table->ReorderColumnDstOrder); table->ReorderColumnDstOrder = -1; } + + // Release + ImGuiContext& g = *GImGui; + if (g.ActiveId == 0) // FIXME: Need to revisit. See 38f5e5a. + table->ReorderColumn = -1; + //if (table->HeldHeaderColumn == -1 && table->ReorderColumn != -1) + // table->ReorderColumn = -1; } // Handle display order reset request