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

drag input via keyboard has no effect #2557

Closed
krumelmonster opened this issue May 15, 2019 · 3 comments
Closed

drag input via keyboard has no effect #2557

krumelmonster opened this issue May 15, 2019 · 3 comments
Labels

Comments

@krumelmonster
Copy link

krumelmonster commented May 15, 2019

Version/Branch of Dear ImGui:

Version: 1.71 git (fc3c3de)
Branch: master

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_opengl3.cpp; imgui_impl_glfw.cpp; GLEW
Compiler: gcc 8.3.0
Operating System: GNU/Linux

My Issue/Question:

Double clicking an input in a ColorEdit without ImGuiColorEditFlags_NoInputs (e.g. the either R, G or B integer in the demo but this seems to be an issue with drags in general) opens up a temporary input where I can enter a new value. However it does not seem to be possible to set the respective color component to that new value e.g. by pressing enter. Because TempInputTextScalar will always return false, causing value_changed in ColorEdit4 to not be set in such cases.

Screenshots/Video

2019-05-15-222741_217x28_scrot
double clicking either of the values will let me type a new value, however, changes are lost on focus change/enter press, the color won't change.

// From the example
ImGui::ColorEdit3("clear color", (float*)&clear_color);
@krumelmonster krumelmonster changed the title ColorEdit drag input via keyboard has no effect drag input via keyboard has no effect May 15, 2019
@krumelmonster
Copy link
Author

krumelmonster commented May 15, 2019

e6d5f23 allows submitting a value only via the enter key not by other ways of changing focus (tab key) without cancelling input (escape key). Furthermore, no bounds checking is performed. If the patch is appreciated, I'd like to change these as well if we agree on what'd be expected behaviour.

@ocornut ocornut added the bug label May 18, 2019
@ocornut
Copy link
Owner

ocornut commented May 18, 2019

Thank you @krumelmonster for reporting this. This appear to have been broken by d3a387c for #2034 a few days ago. I'll look into fixing now.

@ocornut
Copy link
Owner

ocornut commented May 18, 2019

Should be fixed now.

Because TempInputTextScalar will always return false

That was the bug added a few days ago.
Added regression tests for this.

@ocornut ocornut closed this as completed May 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants