Skip to content

Regression? IsItemDeactivatedAfterEdit on InputScalar step buttons doesn't happen on frame writing to backing data #8149

Open
@olivier-gerard

Description

Version/Branch of Dear ImGui:

Version 1.95.5

Back-ends:

imgui_impl_Vulkan.cpp + imgui_impl_GLFW.cpp

Compiler, OS:

Windows 11, Visual Studio 2022

Full config/build information:

No response

Details:

My Issue/Question:

Hi,
I noted a regression from 1.91.4 using IsItemDeactivatedAfterEdit() on 'temporary' (I mean not static nor saved in global objects) values.
With 1.91.4 I used to get the new value after calling IsItemDeactivatedAfterEdit(), now I always get the value before user input.

I didn't find anything on the changelog about it, and believe I have no particular configuration regarding this.
Anyway just changing the version of DearImgui changes the behavior.

I provide a small example below, better than words.
(I use this trick with temporary objects to resize vectors.)

Hope this is clear enough.
Regards

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

 static int bak = 10;
 int tmp = bak;
 ImGui::InputInt("tmp", &tmp);
 if (ImGui::IsItemDeactivatedAfterEdit()) {
     int newval = tmp; //now always 10, was 9/11/user input in 1.91.4
 }

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions