mirror of
https://github.com/ocornut/imgui.git
synced 2026-02-02 03:40:06 +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:
parent
605a751571
commit
7d33524042
2 changed files with 5 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue