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:
parent
e60d204302
commit
8d8e2da57e
@ -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();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user