From 94c46d74869ec991c101c187088da0f25d6c8e40 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 21 Jun 2023 14:20:13 +0200 Subject: [PATCH] InputText: Fixed not returning true when buffer is cleared by ImGuiInputTextFlags_EscapeClearsAll. (#5688, #2620) --- docs/CHANGELOG.txt | 1 + imgui.h | 2 +- imgui_widgets.cpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 926b09a95..ad77b8e7b 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -67,6 +67,7 @@ Other changes: - IsWindowHovered, IsItemHovered: Assert when passed any unsupported flags. - Tables: Fixed a regression in 1.89.6 leading to the first column of tables with either ScrollX or ScrollY flags from being impossible to resize. (#6503) +- InputText: Fixed not returning true when buffer is cleared by ImGuiInputTextFlags_EscapeClearsAll. (#5688, #2620) - Clipper: Rework inner logic to allow functioning with a zero-clear constructor. This is order to facilitate usage for language bindings (e.g cimgui or dear_binding) where user may not be callinga constructor manually. (#5856) diff --git a/imgui.h b/imgui.h index e254e16b3..96d0a3015 100644 --- a/imgui.h +++ b/imgui.h @@ -23,7 +23,7 @@ // Library Version // (Integer encoded as XYYZZ for use in #if preprocessor conditionals, e.g. '#if IMGUI_VERSION_NUM >= 12345') #define IMGUI_VERSION "1.89.7 WIP" -#define IMGUI_VERSION_NUM 18964 +#define IMGUI_VERSION_NUM 18965 #define IMGUI_HAS_TABLE /* diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index d2eaf0fcb..a69917939 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -4573,6 +4573,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ // Clear input apply_new_text = ""; apply_new_text_length = 0; + value_changed |= (buf[0] != 0); STB_TEXTEDIT_CHARTYPE empty_string; stb_textedit_replace(state, &state->Stb, &empty_string, 0); }