From 9043c1872511d3aaac221667ab669659c564a9e7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 3 Jun 2024 22:26:59 +0400 Subject: [PATCH] Don't drop search on non-empty backspace. --- Telegram/SourceFiles/dialogs/dialogs_widget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp index 9965c2ac43..7ff4207040 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp @@ -3425,7 +3425,8 @@ void Widget::keyPressEvent(QKeyEvent *e) { //} } else if ((e->key() == Qt::Key_Backspace || e->key() == Qt::Key_Tab) && _searchHasFocus - && !_searchState.inChat) { + && !_searchState.inChat + && _searchState.query.isEmpty()) { escape(); } else if (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) { submit();