mirror of
https://github.com/ocornut/imgui.git
synced 2026-02-17 17:08:33 +00:00
InputText: fixed an issue where using Escape with ImGuiInputTextFlags_EscapeClearsAll. (#8915, #8273)
Regression test: "widgets_inputtext_temp_buffer_2"
This commit is contained in:
@@ -4966,7 +4966,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
|
||||
{
|
||||
if (flags & ImGuiInputTextFlags_EscapeClearsAll)
|
||||
{
|
||||
if (buf[0] != 0)
|
||||
if (state->TextA.Data[0] != 0)
|
||||
{
|
||||
revert_edit = true;
|
||||
}
|
||||
@@ -5058,7 +5058,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
|
||||
if (flags & ImGuiInputTextFlags_EscapeClearsAll)
|
||||
{
|
||||
// Clear input
|
||||
IM_ASSERT(buf[0] != 0); // FIXME: use TextA here?
|
||||
IM_ASSERT(state->TextA.Data[0] != 0);
|
||||
apply_new_text = "";
|
||||
apply_new_text_length = 0;
|
||||
value_changed = true;
|
||||
|
||||
Reference in New Issue
Block a user