diff --git a/src/calibre/gui2/complete2.py b/src/calibre/gui2/complete2.py index eb28c38881..dad2e21d90 100644 --- a/src/calibre/gui2/complete2.py +++ b/src/calibre/gui2/complete2.py @@ -185,11 +185,14 @@ class Completer(QListView): # {{{ e.accept() return True if key in (Qt.Key_Enter, Qt.Key_Return): - if not self.currentIndex().isValid(): - self.hide() - e.accept() - return True - return False + # We handle this explicitly because on OS X activated() is + # not emitted on pressing Enter. + idx = self.currentIndex() + if idx.isValid(): + self.item_chosen(idx) + self.hide() + e.accept() + return True if key in (Qt.Key_PageUp, Qt.Key_PageDown): # Let the list view handle these keys return False