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
tokarchuk/v1.17
Tyrone Yeh 2 years ago committed by GitHub
parent 2f0a1eb0d5
commit fbde31fb1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      web_src/js/features/comp/EasyMDE.js

@ -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);

Loading…
Cancel
Save