-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
IsItemActive() always return false after calling InputFloat() #840
Comments
Definitively a bug, needs to be fixed!
|
This is possible workaround. But @@ -8306,7 +8306,9 @@ bool ImGui::InputScalarEx(const char* label, ImGuiDataType data_type, void* data
RenderText(ImVec2(window->DC.CursorPos.x, window->DC.CursorPos.y + style.FramePadding.y), label);
ItemSize(label_size, style.FramePadding.y);
}
+ auto lastItemId = window->DC.LastItemId;
EndGroup();
+ window->DC.LastItemId = lastItemId;
return value_changed;
} |
I don't see any reason for a lag there. IsItemActive() will test those values directly. Did you confirm the lag? However this need a little adjustment/work-around to also function when the Steps buttons are enabled. |
I have applied the more general fix where if any item within the group is the active id, then IsItemActive() after EndGroup() will report true. This fix similar issue for other widgets using BeginGroup(), and allow removal of similar workaround code in InputTextMultiline(). Repro
The lag is a different issue, if you are talking about
Looking into that. |
Fixed the other issue. |
@ocornut Thank you! |
IsItemActive()
always returnfalse
after callingImGui::InputFloat(...)
.InputFloat
is implemented usingInputScalerEx
which wrapsInputText
in group. EndGroup() modifywindow->DC.LastItemId
and ing.ActiveId == window->DC.LastItemId
inIsItemActive()
is always false.Is this a real issue or expected behavior?
The text was updated successfully, but these errors were encountered: