mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-06 04:58:47 +02:00
InputText: added experimental io.ConfigInputTextEnterKeepActive feature to make pressing Enter keep the input active and select all text.
This commit is contained in:
@ -4368,7 +4368,11 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
|
||||
bool ctrl_enter_for_new_line = (flags & ImGuiInputTextFlags_CtrlEnterForNewLine) != 0;
|
||||
if (!is_multiline || (ctrl_enter_for_new_line && !io.KeyCtrl) || (!ctrl_enter_for_new_line && io.KeyCtrl))
|
||||
{
|
||||
validated = clear_active_id = true;
|
||||
validated = true;
|
||||
if (io.ConfigInputTextEnterKeepActive && !is_multiline)
|
||||
state->SelectAll(); // No need to scroll
|
||||
else
|
||||
clear_active_id = true;
|
||||
}
|
||||
else if (!is_readonly)
|
||||
{
|
||||
|
Reference in New Issue
Block a user