Ver Fonte

LibGUI: Don't open windows for editable ComboBoxes when typing

Fixes inability to type custom values into ComboBox editors.

CaptureInput preempts typing while the ListView window is open.
For now, searching can still be done by manually opening the window.
thankyouverycool há 2 anos atrás
pai
commit
04a9562601
1 ficheiros alterados com 2 adições e 0 exclusões
  1. 2 0
      Userland/Libraries/LibGUI/ComboBox.cpp

+ 2 - 0
Userland/Libraries/LibGUI/ComboBox.cpp

@@ -90,6 +90,8 @@ ComboBox::ComboBox()
             m_open_button->click();
     };
     m_editor->on_keypress = [this](KeyEvent& event) {
+        if (!m_only_allow_values_from_model)
+            return;
         if (!m_list_window->is_visible() && event.key() <= Key_Z && event.key() >= Key_A) {
             open();
             m_list_window->event(event);