1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:28:11 +00:00

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.
This commit is contained in:
thankyouverycool 2022-09-21 07:19:50 -04:00 committed by Andreas Kling
parent 7c2edd232d
commit 04a9562601

View file

@ -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);