Skip to content

Commit e7b5bf0

Browse files
authored
Add down key check has tribute container (#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
1 parent de7b87f commit e7b5bf0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

web_src/js/features/comp/EasyMDE.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,18 @@ export async function createCommentEasyMDE(textarea, easyMDEOptions = {}) {
9292
}
9393
cm.execCommand('delCharBefore');
9494
},
95+
Up: (cm) => {
96+
const tributeContainer = document.querySelector('.tribute-container');
97+
if (!tributeContainer || tributeContainer.style.display === 'none') {
98+
return cm.execCommand('goLineUp');
99+
}
100+
},
101+
Down: (cm) => {
102+
const tributeContainer = document.querySelector('.tribute-container');
103+
if (!tributeContainer || tributeContainer.style.display === 'none') {
104+
return cm.execCommand('goLineDown');
105+
}
106+
},
95107
});
96108
await attachTribute(inputField, {mentions: true, emoji: true});
97109
attachEasyMDEToElements(easyMDE);

0 commit comments

Comments
 (0)