Open santorac opened 2 years ago
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
https://user-images.githubusercontent.com/55155825/162859796-df7c5e94-4660-40b0-a8b3-4cd76aab245f.mp4
Standalone, minimal, complete and verifiable example: (see https://github.com/ocornut/imgui/issues/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.