You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Back-ends: working within Open 3D Engine
Compiler: Visual Studio 2019
Operating System: Windows 10
My Issue/Question:
I have a slider and only want to apply the changes after the slider is released, so I'm using IsItemDeactivatedAfterEdit(). If a modal popup is opened while the slider is being dragged, then the slider is deactivated when focus is lost, and IsItemDeactivatedAfterEdit() never returns true. I'd like IsItemDeactivatedAfterEdit() to return true either before the popup is opened (preferably) or after the popup is closed.
Screenshots/Video
IsItemDeactivatedAfterEdit_Interrupted.mp4
Standalone, minimal, complete and verifiable example:(see #2261)
Here is a snippet of test code to demonstrate the issue, place something like this in a per-frame tick function. If you drag and release the slider before the modal popup, then "Applied Count" will be incremented, and "Applied Value" will be updated to the slider value. If you hold the slider until the popup happens, then the value will not be applied.
static float time = 0.0f;
time += deltaTime;
static float testValue = 0.0f;
static float appliedValue = 0.0f;
static int applyCounter = 0;
static const char* modalPopupName = "Interruption";
if (ImGui::Begin("TEST"))
{
ImGui::SliderFloat("Slider", &testValue, 0.0f, 1.0f);
bool applyChanges = ImGui::IsItemDeactivatedAfterEdit();
if (applyChanges)
{
applyCounter++;
appliedValue = testValue;
}
ImGui::LabelText("Applied Count", "%d", applyCounter);
ImGui::LabelText("Applied Value", "%f", appliedValue);
if (time > 3.0f)
{
ImGui::OpenPopup(modalPopupName);
if (ImGui::BeginPopupModal(modalPopupName))
{
ImGui::Text("Interrupted!");
ImGui::EndPopup();
}
if (time > 4.0f)
{
time = 0.0f;
}
}
}
ImGui::End();
The text was updated successfully, but these errors were encountered:
Thanks for reporting, I can confirm the issue.
While not the same there's a little bit of overlap with #4714 (which I have a 90% fix for, but didn't finish it). I believe the solution for this (#5184) may lead t improving my solution for #4714.
Version/Branch of Dear ImGui:
Version: v1.82
Branch: unknown
Back-end/Renderer/Compiler/OS
Back-ends: working within Open 3D Engine
Compiler: Visual Studio 2019
Operating System: Windows 10
My Issue/Question:
I have a slider and only want to apply the changes after the slider is released, so I'm using IsItemDeactivatedAfterEdit(). If a modal popup is opened while the slider is being dragged, then the slider is deactivated when focus is lost, and IsItemDeactivatedAfterEdit() never returns true. I'd like IsItemDeactivatedAfterEdit() to return true either before the popup is opened (preferably) or after the popup is closed.
Screenshots/Video
IsItemDeactivatedAfterEdit_Interrupted.mp4
Standalone, minimal, complete and verifiable example: (see #2261)
Here is a snippet of test code to demonstrate the issue, place something like this in a per-frame tick function. If you drag and release the slider before the modal popup, then "Applied Count" will be incremented, and "Applied Value" will be updated to the slider value. If you hold the slider until the popup happens, then the value will not be applied.
The text was updated successfully, but these errors were encountered: