Fix archive search input field focus.

This commit is contained in:
John Preston 2019-05-26 14:49:12 +02:00
parent d2d51cc883
commit a49a96ba33
2 changed files with 7 additions and 4 deletions

View File

@ -639,7 +639,9 @@ void Widget::animationCallback() {
updateControlsVisibility(true);
applyFilterUpdate();
if (App::wnd()) App::wnd()->setInnerFocus();
if (!_filter->hasFocus()) {
if (App::wnd()) App::wnd()->setInnerFocus();
}
}
}
@ -1232,6 +1234,9 @@ void Widget::searchInChat(Key chat) {
}
void Widget::setSearchInChat(Key chat, UserData *from) {
if (chat.folder()) {
chat = Key();
}
_searchInMigrated = nullptr;
if (const auto peer = chat.peer()) {
if (const auto migrateTo = peer->migrateTo()) {

View File

@ -169,9 +169,7 @@ void TopBarWidget::refreshLang() {
}
void TopBarWidget::onSearch() {
if (_activeChat.folder()) {
_controller->closeFolder();
} else if (_activeChat) {
if (_activeChat) {
App::main()->searchInChat(_activeChat);
}
}