diff --git a/Userland/Libraries/LibGUI/ComboBox.cpp b/Userland/Libraries/LibGUI/ComboBox.cpp index e84846b523..ff221dccf2 100644 --- a/Userland/Libraries/LibGUI/ComboBox.cpp +++ b/Userland/Libraries/LibGUI/ComboBox.cpp @@ -7,10 +7,12 @@ #include #include #include +#include #include #include #include #include +#include #include REGISTER_WIDGET(GUI, ComboBox) @@ -36,6 +38,16 @@ private: if (on_mousewheel) on_mousewheel(event.wheel_delta()); } + + virtual void keydown_event(KeyEvent& event) override + { + if (event.key() == Key_Escape) { + if (is_focused()) + set_focus(false); + event.accept(); + } else + TextEditor::keydown_event(event); + } }; ComboBox::ComboBox()