Skip to content

Commit

Permalink
Add down key check has tribute container (go-gitea#21016) (go-gitea#2…
Browse files Browse the repository at this point in the history
…1038)

Backport go-gitea#21016 

Fixes an issue where users would not be able to select by pressing the down arrow when using @tag above a message

Bug videos:

https://user-images.githubusercontent.com/1255041/188095999-c4ccde18-e53b-4251-8a14-d90c4042d768.mp4
  • Loading branch information
tyroneyeh authored Sep 3, 2022
1 parent 2f0a1eb commit fbde31f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions web_src/js/features/comp/EasyMDE.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,18 @@ export async function createCommentEasyMDE(textarea, easyMDEOptions = {}) {
}
cm.execCommand('delCharBefore');
},
Up: (cm) => {
const tributeContainer = document.querySelector('.tribute-container');
if (!tributeContainer || tributeContainer.style.display === 'none') {
return cm.execCommand('goLineUp');
}
},
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 fbde31f

Please sign in to comment.