diff --git a/cockatrice/src/window_deckeditor.cpp b/cockatrice/src/window_deckeditor.cpp index acb3bf54..0355a62e 100644 --- a/cockatrice/src/window_deckeditor.cpp +++ b/cockatrice/src/window_deckeditor.cpp @@ -268,6 +268,9 @@ void WndDeckEditor::updateCardInfoRight(const QModelIndex ¤t, const QModel void WndDeckEditor::updateSearch(const QString &search) { databaseDisplayModel->setCardNameBeginning(search); + QModelIndexList sel = databaseView->selectionModel()->selectedRows(); + if (sel.isEmpty() && databaseDisplayModel->rowCount()) + databaseView->selectionModel()->setCurrentIndex(databaseDisplayModel->index(0, 0), QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); } bool WndDeckEditor::confirmClose()