Skip to content

Commit

Permalink
Fix EasyMDE error when input Enter (go-gitea#19004)
Browse files Browse the repository at this point in the history
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
  • Loading branch information
wxiaoguang and lunny authored Mar 5, 2022
1 parent 814750e commit 3e28fa7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web_src/js/features/comp/EasyMDE.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ export async function createCommentEasyMDE(textarea, easyMDEOptions = {}) {
const inputField = easyMDE.codemirror.getInputField();
inputField.classList.add('js-quick-submit');
easyMDE.codemirror.setOption('extraKeys', {
Enter: () => {
Enter: (cm) => {
const tributeContainer = document.querySelector('.tribute-container');
if (!tributeContainer || tributeContainer.style.display === 'none') {
return window.CodeMirror.Pass;
cm.execCommand('newlineAndIndent');
}
},
Backspace: (cm) => {
Expand Down

0 comments on commit 3e28fa7

Please sign in to comment.