Skip to content

SetKeyboardFocusHere() does not work with InputTextMultiline + ImGuiInputTextFlags_AllowTabInput #8928

Description

@Counter-clock

Version/Branch of Dear ImGui:

Version 1.92.2b, Branch: master

Back-ends:

imgui_impl_win32.cpp + imgui_impl_dx11.cpp

Compiler, OS:

Windows 11 + MSVC 2022

Details:

Using SetKeyboardFocusHere() with InputTextMultiline() and the ImGuiInputTextFlags_AllowTabInput flag, does not make the item keyboard focused, as it should.

In contrast, using it with InputTextMultiline() alone works as expected and InputText() behaves correctly with or without the ImGuiInputTextFlags_AllowTabInput flag.

Issue Example:

static char buf[256] = "";
static bool focusInput = false;

if (ImGui::Button("Focus Input"))
    focusInput = true;

if (focusInput) {
    ImGui::SetKeyboardFocusHere(0);
    focusInput = false;
}

ImGui::InputTextMultiline("##TextInput", buf, IM_ARRAYSIZE(buf), ImVec2(350.0f, 200.0f), ImGuiInputTextFlags_AllowTabInput );

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions