-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Multiple checkboxes with no label don't get click event #3375
Copy link
Copy link
Closed
Labels
label/id and id stackimplicit identifiers, pushid(), id stackimplicit identifiers, pushid(), id stack
Description
Branch: latest docking + tables merged
Back-ends: imgui_impl_allegro5.cpp
Operating System: ubuntu 20.04 Linux
See code sample.
Hovering works fine, but if you click on the checkbox in the 2nd column of the table,
instead it expands the 1st column's width. Adding a label seems to fix the bug as work-around.
Cheers
void
show_bug()
{
ImGui::SetNextWindowSize(ImVec2(400, 200), ImGuiCond_Always);
bool window_visible = true;
if (ImGui::Begin("MyWindow", &window_visible))
{
static ImGuiTableFlags flags = ImGuiTableFlags_BordersV | ImGuiTableFlags_BordersHOuter | ImGuiTableFlags_Resizable | ImGuiTableFlags_RowBg;
if (ImGui::BeginTable("##Table", 2, flags))
{
ImGui::TableNextRow();
ImGui::LabelText("", "checkbox");
ImGui::TableNextCell();
static bool mybool=0;
ImGui::Checkbox("", &mybool);
// ImGui::Checkbox(" ", &mybool); // FIX: adding a label fixes the bug
ImGui::TableNextRow();
ImGui::EndTable();
}
ImGui::End();
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
label/id and id stackimplicit identifiers, pushid(), id stackimplicit identifiers, pushid(), id stack