1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:47:36 +00:00

Browser: Focus input text field in JS console by default

This commit is contained in:
Nico Weber 2020-07-22 21:19:34 -04:00 committed by Andreas Kling
parent 79a5ba58a5
commit 107db38a51
2 changed files with 7 additions and 0 deletions

View file

@ -165,4 +165,8 @@ void ConsoleWidget::clear_output()
m_output_view->update();
}
void ConsoleWidget::focusin_event(Core::Event&)
{
m_input->set_focus(true);
}
}

View file

@ -47,6 +47,9 @@ public:
private:
ConsoleWidget();
virtual bool accepts_focus() const override { return true; }
virtual void focusin_event(Core::Event&) override;
RefPtr<GUI::TextBox> m_input;
RefPtr<Web::PageView> m_output_view;
RefPtr<Web::Element> m_output_container;