Skip to content

Commit

Permalink
Fixed IsItemDeactivatedAfterEdit() signal being broken for Checkbox()…
Browse files Browse the repository at this point in the history
…, RadioButton(), Selectable(). (ocornut#8370)

Item is already made inactive at the time of calling MarkItemEdited().
Fix a604d4f
  • Loading branch information
ocornut committed Feb 3, 2025
1 parent f820bf7 commit 6265339
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ Breaking changes:

Other changes:

- Fixed IsItemDeactivatedAfterEdit() signal being broken for Checkbox(), Selectable(). (#8370)
Regression from 2025/01/13.


-----------------------------------------------------------------------
VERSION 1.91.8 (Released 2025-01-31)
Expand Down
3 changes: 3 additions & 0 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4440,8 +4440,11 @@ void ImGui::MarkItemEdited(ImGuiID id)
return;
if (g.ActiveId == id || g.ActiveId == 0)
{
// FIXME: Can't we fully rely on LastItemData yet?
g.ActiveIdHasBeenEditedThisFrame = true;
g.ActiveIdHasBeenEditedBefore = true;
if (g.DeactivatedItemData.ID == id)
g.DeactivatedItemData.HasBeenEditedBefore = true;
}

// We accept a MarkItemEdited() on drag and drop targets (see https://github.com/ocornut/imgui/issues/1875#issuecomment-978243343)
Expand Down

0 comments on commit 6265339

Please sign in to comment.