Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabled item within scrollable table still responds to keyboard input #5189

Closed
lethal-guitar opened this issue Apr 12, 2022 · 2 comments
Closed
Labels
bug nav keyboard/gamepad navigation

Comments

@lethal-guitar
Copy link
Contributor

lethal-guitar commented Apr 12, 2022

Version/Branch of Dear ImGui:

Version: 1.88 WIP (18717)
Branch: master

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_sdl.cpp + imgui_impl_opengl3.cpp
Operating System: Windows 10, Mac OS 10.14

My Issue/Question:

When using a scrollable table, BeginDisabled/EndDisabled within a table cell doesn't prevent keyboard input (ImGuiConfigFlags_NavEnableKeyboard). This only seems to be a problem for the first row.
I experienced this with a checkbox. I haven't checked other widgets, and I haven't tested gamepad input yet.

Mouse interaction is prevented as expected, and this issue does not occur if ImGuiTableFlags_ScrollY is not used.

Screenshots/Video

ImguiBug.mov

Standalone, minimal, complete and verifiable example: (see #2261)

if (ImGui::BeginTable("example", 1, ImGuiTableFlags_ScrollY))
{
  ImGui::TableNextRow();
  ImGui::TableNextColumn();

  ImGui::BeginDisabled(true);
  ImGui::Checkbox("Test", &test);
  ImGui::EndDisabled();

  ImGui::EndTable();
}
@lethal-guitar lethal-guitar changed the title Disabled item within scrollable table still responds to keyboard interaction Disabled item within scrollable table still responds to keyboard input Apr 12, 2022
@ocornut ocornut added tables/columns nav keyboard/gamepad navigation bug and removed tables/columns labels Apr 13, 2022
ocornut added a commit that referenced this issue Apr 13, 2022
@ocornut
Copy link
Owner

ocornut commented Apr 13, 2022

Thank for reporting! Fixed with 088487a.

As a understand, the issue doesn't have to do with tables or "first row", but it happened when starting navigation inside a window where there are ONLY disabled items. Should be fixed now.

@ocornut ocornut closed this as completed Apr 13, 2022
@lethal-guitar
Copy link
Contributor Author

lethal-guitar commented Apr 13, 2022

Ah nice, that was very quick! Thank you.

As a understand, the issue doesn't have to do with tables or "first row", but it happened when starting navigation inside a window where there are ONLY disabled items.

Ah yeah that could be, in my real world example the table had more than one row but all checkboxes were disabled. So it would match that scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug nav keyboard/gamepad navigation
Projects
None yet
Development

No branches or pull requests

2 participants