Browse Source

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 2 years ago
parent
commit
04a9562601
1 changed files with 2 additions and 0 deletions
  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);