From c79d16a0d6e8255fc41585366776eb61901dd2f1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 8 Dec 2017 13:30:30 +0400 Subject: [PATCH] Auto-choose first search row in PeerListBox. --- Telegram/SourceFiles/boxes/peer_list_box.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/boxes/peer_list_box.cpp b/Telegram/SourceFiles/boxes/peer_list_box.cpp index 88a4b3c28..d4e9aad9f 100644 --- a/Telegram/SourceFiles/boxes/peer_list_box.cpp +++ b/Telegram/SourceFiles/boxes/peer_list_box.cpp @@ -1362,8 +1362,12 @@ void PeerListContent::setSearchQuery( } void PeerListContent::submitted() { - if (auto row = getRow(_selected.index)) { + if (const auto row = getRow(_selected.index)) { _controller->rowClicked(row); + } else if (showingSearch()) { + if (const auto row = getRow(RowIndex(0))) { + _controller->rowClicked(row); + } } }