Skip to content

Commit

Permalink
UI/Qt: Do not perform search if query text is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
ronak69 authored and tcl3 committed Sep 19, 2024
1 parent d19b315 commit 276ad23
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Ladybird/Qt/LocationEdit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ LocationEdit::LocationEdit(QWidget* parent)
});

connect(this, &QLineEdit::returnPressed, [&] {
if (text().isEmpty())
return;

clearFocus();

Optional<StringView> search_engine_url;
Expand Down
2 changes: 2 additions & 0 deletions Ladybird/Qt/Tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,8 @@ void Tab::copy_link_url(URL::URL const& url)

void Tab::location_edit_return_pressed()
{
if (m_location_edit->text().isEmpty())
return;
navigate(m_location_edit->url());
}

Expand Down

0 comments on commit 276ad23

Please sign in to comment.