Browse Source

Fix Enter not working in SimpleMDE (#11564)

* Fix Enter not working in SimpleMDE

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

Fixes: https://github.com/go-gitea/gitea/issues/11559

* fix it for absent tribute too
for-closed-social
silverwind 4 years ago
committed by GitHub
parent
commit
1752a976e1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      web_src/js/index.js

+ 1
- 1
web_src/js/index.js View File

@ -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;
}
},

Loading…
Cancel
Save