Skip to content

Commit

Permalink
Add down key check has tribute container
Browse files Browse the repository at this point in the history
  • Loading branch information
tyroneyeh committed Sep 1, 2022
1 parent d74390e commit 2883e24
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions web_src/js/features/comp/EasyMDE.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ export async function createCommentEasyMDE(textarea, easyMDEOptions = {}) {
}
cm.execCommand('delCharBefore');
},
Down: (cm) => {
const tributeContainer = document.querySelector('.tribute-container');
if (!tributeContainer || tributeContainer.style.display === 'none') {
return cm.execCommand('goLineDown');
}
},
});
attachTribute(inputField, {mentions: true, emoji: true});
attachEasyMDEToElements(easyMDE);
Expand Down

0 comments on commit 2883e24

Please sign in to comment.