Fix weird issue with text editor capturing enter key without having focus

This commit is contained in:
Veronica K. B. Olsen committed 2020-06-16 20:44:24 +02:00
1 parent 2c5692085e
commit 8755434f76
1 file changed
+3
+3
View File
@@ -591,6 +591,9 @@ class GuiDocEditor(QTextEdit):
as it is triggered on every keypress when typing.
"""
self.hasSelection = self.textCursor().hasSelection()
if not self.hasFocus():
# Block the event when the focus is on the search bar.
return
if keyEvent.modifiers() == Qt.ShiftModifier:
theKey = keyEvent.key()