diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 4e75a1fa5..b3a1fe773 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -49,8 +49,6 @@ Other Changes: EndTable() was mistakenly restoring a wrong current table. - Disabled: fixed a bug when a previously enabled item that got nav focus and then turns disabled could still be activated using keyboard. (#9036) -- InputText: when buffer is not resizable, trying to paste contents that - cannot fit will now truncate text instead of ignoring the paste. (#9029) - InputText: avoid continuously overwriting ownership of ImGuiKey_Enter/_KeypadEnter keys in order to allow e.g. external Shortcut override behavior. (#9004) - InputText: when using a callback to reduce/manipulate the value of BufTextLen, diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index f36973992..0d2c9507b 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -4155,7 +4155,7 @@ static int STB_TEXTEDIT_INSERTCHARS(ImGuiInputTextState* obj, int pos, const cha // We support partial insertion (with a mod in stb_textedit.h) const int avail = obj->BufCapacity - 1 - obj->TextLen; if (!is_resizable && new_text_len > avail) - new_text_len = avail; // 0 + new_text_len = 0; // avail if (new_text_len == 0) return 0; @@ -4314,7 +4314,7 @@ void ImGuiInputTextCallbackData::InsertChars(int pos, const char* new_text, cons // We support partial insertion (with a mod in stb_textedit.h) const int avail = BufSize - 1 - BufTextLen; if (!is_resizable && new_text_len > avail) - new_text_len = avail; // 0 + new_text_len = 0; // avail if (new_text_len == 0) return;