diff --git a/plugins/ui/include/popups/popup_file_chooser.hpp b/plugins/ui/include/popups/popup_file_chooser.hpp index 90966b6fd..950bb1511 100644 --- a/plugins/ui/include/popups/popup_file_chooser.hpp +++ b/plugins/ui/include/popups/popup_file_chooser.hpp @@ -46,6 +46,11 @@ namespace hex::ui { void drawContent() override { bool doubleClicked = false; + if (m_justOpened) { + ImGui::SetKeyboardFocusHere(); + m_justOpened = false; + } + ImGui::PushItemWidth(-1); ImGuiExt::InputTextIcon("##search", ICON_VS_FILTER, m_filter); ImGui::PopItemWidth(); @@ -123,6 +128,7 @@ namespace hex::ui { std::function m_openCallback; std::vector m_validExtensions; bool m_multiple = false; + bool m_justOpened = true; }; class PopupNamedFileChooser : public PopupNamedFileChooserBase {