Skip to content

Commit

Permalink
Fix Enter not working in SimpleMDE (#11564)
Browse files Browse the repository at this point in the history
* Fix Enter not working in SimpleMDE

This condition was wrongly inverted, leading to all enter keys being
blocked.

Fixes: #11559

* fix it for absent tribute too
  • Loading branch information
silverwind committed May 23, 2020
1 parent 5789e60 commit 1752a97
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web_src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,7 @@ function setCommentSimpleMDE($editArea) {
simplemde.codemirror.setOption('extraKeys', {
Enter: () => {
const tributeContainer = document.querySelector('.tribute-container');
if (tributeContainer && tributeContainer.style.display !== 'none') {
if (!tributeContainer || tributeContainer.style.display === 'none') {
return CodeMirror.Pass;
}
},
Expand Down

0 comments on commit 1752a97

Please sign in to comment.