Skip to content

Commit fbde31f

Browse files
authored
Add down key check has tribute container (#21016) (#21038)
Backport #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 2f0a1eb commit fbde31f

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
@@ -90,6 +90,18 @@ export async function createCommentEasyMDE(textarea, easyMDEOptions = {}) {
9090
}
9191
cm.execCommand('delCharBefore');
9292
},
93+
Up: (cm) => {
94+
const tributeContainer = document.querySelector('.tribute-container');
95+
if (!tributeContainer || tributeContainer.style.display === 'none') {
96+
return cm.execCommand('goLineUp');
97+
}
98+
},
99+
Down: (cm) => {
100+
const tributeContainer = document.querySelector('.tribute-container');
101+
if (!tributeContainer || tributeContainer.style.display === 'none') {
102+
return cm.execCommand('goLineDown');
103+
}
104+
},
93105
});
94106
attachTribute(inputField, {mentions: true, emoji: true});
95107
attachEasyMDEToElements(easyMDE);

0 commit comments

Comments
 (0)