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

SliderInt & Combo without label text interaction issue #2475

Closed
ElectricSquid opened this issue Apr 6, 2019 · 2 comments
Closed

SliderInt & Combo without label text interaction issue #2475

ElectricSquid opened this issue Apr 6, 2019 · 2 comments
Labels
label/id and id stack implicit identifiers, pushid(), id stack

Comments

@ElectricSquid
Copy link

Version/Branch of Dear ImGui:

Version: 1.69
Branch: MASTER

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_win32.cpp + imgui_impl_dx11.cpp
Compiler: VS2017
Operating System: Windows 10

My Issue/Question:

When you have a SliderInt above a Combo, without text in the label fields of both, when interacting with the combo, it will interact with the slider instead. If you however have a label propagated on either, the issue does not persist.

Is this behavior a bug, or is this expected? I do not wish to have text next to either the slider or combo in my project so it would be nice if I don't need it.

Screenshots/Video

Here's an example without the text, creating the issue.
imgui_bug_notext

Here's another example but with text that eliminates the issue.
imgui_bug_withtext

Standalone, minimal, complete and verifiable example:

{
            ImGui::Begin("Test Window");

            static int int0= 0;
            ImGui::PushItemWidth(200);
            ImGui::SliderInt("", &int0, 0, 6);

            const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD" };
            static int item_current = 0;
            ImGui::Combo("", &item_current, items, IM_ARRAYSIZE(items));

            ImGui::End();
}

This one with text propagating the combo to eliminate the issue.

{
            ImGui::Begin("Test Window");

            static int int0= 0;
            ImGui::PushItemWidth(200);
            ImGui::SliderInt("", &int0, 0, 6);

            const char* items[] = { "AAAA", "BBBB", "CCCC", "DDDD" };
            static int item_current = 0;
            ImGui::Combo("combo", &item_current, items, IM_ARRAYSIZE(items));

            ImGui::End();
}
@ocornut
Copy link
Owner

ocornut commented Apr 6, 2019

You haven’t read the FAQ, this is instructed by the issue template. Please read the FAQ and you will have your answer.

@ocornut ocornut closed this as completed Apr 6, 2019
@ocornut ocornut added the label/id and id stack implicit identifiers, pushid(), id stack label Apr 6, 2020
@emrecpp
Copy link

emrecpp commented Mar 5, 2022

just add "##" to start of name,
example;
ImGui::SliderInt("", &int0, 0, 6);
to
ImGui::SliderInt("##myslidername", &int0, 0, 6); // will not show "myslidername" because of ##

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
label/id and id stack implicit identifiers, pushid(), id stack
Projects
None yet
Development

No branches or pull requests

3 participants