diff --git a/src/plugins/qmljseditor/qmljseditor.cpp b/src/plugins/qmljseditor/qmljseditor.cpp
index 65ddfe75489bcf25d6dede3b5635fa4a9ad81b36..16fc356545411ccff80dc1ecfbf2cd2ef48f8f9e 100644
--- a/src/plugins/qmljseditor/qmljseditor.cpp
+++ b/src/plugins/qmljseditor/qmljseditor.cpp
@@ -1058,7 +1058,7 @@ bool QmlJSTextEditor::contextAllowsAutoParentheses(const QTextCursor &cursor, co
             const QStringRef tokenText = blockText.midRef(token.offset, token.length);
             const QChar quote = tokenText.at(0);
 
-            if (ch == quote && isCompleteStringLiteral(tokenText))
+            if (ch != quote || isCompleteStringLiteral(tokenText))
                 break;
 
             return false;