InputText: reworked io.ConfigInputTextEnterKeepActive mode so that pressing Ctrl+Enter or Shift+Enter still allows to deactivate.

cc #9239
This commit is contained in:
ocornut
2026-07-10 21:36:43 +02:00
parent da137cbbb0
commit b62bfd6b06
3 changed files with 4 additions and 2 deletions

View File

@@ -5173,7 +5173,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
if (!is_new_line)
{
validated = clear_active_id = true;
if (io.ConfigInputTextEnterKeepActive && !is_multiline)
if (io.ConfigInputTextEnterKeepActive && !is_multiline && !is_ctrl_enter && !is_shift_enter)
{
// Queue reactivation, so that e.g. IsItemDeactivatedAfterEdit() will work. (#9001)
state->SelectAll(); // No need to scroll