1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-04-14 12:15:48 +02:00

Make Enter key in emoji search insert the first available emoji

This commit is contained in:
chylex 2017-08-30 14:53:43 +02:00
parent e60d204302
commit 8d8e2da57e

View File

@ -193,6 +193,18 @@ enabled(){
e.stopPropagation();
});
searchInput.addEventListener("keydown", function(e){
if (e.keyCode === 13 && $(this).val().length){ // enter
let ele = $(".emoji-keyboard-list").children("img").filter(":visible").first();
if (ele.length > 0){
insertEmoji(ele[0].getAttribute("src"), ele[0].getAttribute("alt"));
}
e.preventDefault();
}
});
searchInput.addEventListener("click", function(){
$(this).select();
});