diff --git a/spyderlib/widgets/sourcecode/base.py b/spyderlib/widgets/sourcecode/base.py
index <HASH>..<HASH> 100644
--- a/spyderlib/widgets/sourcecode/base.py
+++ b/spyderlib/widgets/sourcecode/base.py
@@ -157,10 +157,12 @@ class CompletionWidget(QListWidget):
     

     def focusOutEvent(self, event):

         event.ignore()

+        # Don't hide it on Mac when main window loses focus because

+        # keyboard input is lost

         # Fixes Issue 1318

-        if (sys.platform == "darwin") and \

-          (event.reason() != Qt.ActiveWindowFocusReason):

-            self.hide()

+        if sys.platform == "darwin":

+            if event.reason() != Qt.ActiveWindowFocusReason:

+                self.hide()

         else:

             self.hide()
Completion Widget: Fix revision 5a<I>a2fc1c6 because it wasn't working as expected

Update Issue <I>
Status: Verified

- I commited the previous revision without testing, thinking that it
would work without problems.
- I also added a comment explaining the purpose of the change.