Tables: fixes not releasing ReorderColumn caused by 38f5e5a. Which could break clicking on header to sort. (#9312)

This commit is contained in:
ocornut
2026-04-02 18:57:50 +02:00
parent 65ebca8157
commit 45866bea47

View File

@@ -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