Skip to content

Can't select only 1 input when inputs are slightly close to each other #7581

@AshKetshup

Description

@AshKetshup

Version/Branch of Dear ImGui:

Version 1.89.3 , Branch: master

Back-ends:

imgui_impl_opengl3.cpp + imgui_impl_glfw.cpp

Compiler, OS:

Windows 11 + MSVC 2022

Full config/build information:

No response

Details:

My Issue/Question:

So, I've been using ImGui for over 1 year in this project and I've found this problem more than one time.
When I display multiple inputs slightly close to each other it ends up on trying to select only one of them pick everything from that column p.e... I've seen this appear with ungrouped input too. Here's a few lines of code where this problem exhists:

Even tho I'm using spacing and grouping the input by row it does not allow me to only select one input.
Here's a video to showcase the problem:

Screenshots/Video:

Screen.Recording.-.Made.with.RecordCast.2.webm

Minimal, Complete and Verifiable Example code:

if (ImGui::Begin("Tesselation Shader Properties")) {
	if (tS.levels.size() == 0)
		tS.levels.push_back({ 0.f, 0.f });

	sortVPair(tS.levels);
	static ImGuiTableFlags flags = ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable;

	// When using ScrollX or ScrollY we need to specify a size for our table container!
	// Otherwise by default the table will fit all available space, like a BeginChild() call.
	if (ImGui::BeginTable("table_scrolly", 1, flags, ImVec2(-FLT_MIN, 5 * ImGui::GetTextLineHeightWithSpacing()))) {

		for (size_t row = 0; row < tS.levels.size(); row++) {
			ImGui::BeginGroup();

			ImGui::TableNextRow();

			float* x[2] = { &tS.levels[row].first, &tS.levels[row].second };

			ImGui::TableNextColumn();
			ImGui::DragFloat2("", *x);

			ImGui::EndGroup();

			ImGui::Spacing();
		}

		ImGui::EndTable();

	}
(...)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions