Skip to content

Commit

Permalink
InputText: Fixed calling callback on frame of losing active id, fix p…
Browse files Browse the repository at this point in the history
…art of 848e62b (nav branch only)

#323 #701
  • Loading branch information
ocornut committed Aug 13, 2016
1 parent a83f9b7 commit 9501cd9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8695,7 +8695,7 @@ bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2
}

bool cancel_edit = false;
if (g.ActiveId == id && !g.ActiveIdIsJustActivated)
if (g.ActiveId == id && !g.ActiveIdIsJustActivated && !clear_active_id)
{
// Handle key-presses
const int k_mask = (io.KeyShift ? STB_TEXTEDIT_K_SHIFT : 0);
Expand Down Expand Up @@ -8806,7 +8806,7 @@ bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2
value_changed = true;
}
}
else
if (!cancel_edit && !clear_active_id)
{
// Apply new value immediately - copy modified buffer back
// Note that as soon as the input box is active, the in-widget value gets priority over any underlying modification of the input buffer
Expand Down

0 comments on commit 9501cd9

Please sign in to comment.