Select highlighted emoji on semicolon

This commit is contained in:
Bojan Mojsilovic 2023-09-11 15:07:51 +02:00
parent 8070e04194
commit 49d60500f6
2 changed files with 15 additions and 4 deletions

View File

@ -241,7 +241,7 @@ const EditBox: Component<{
return false;
}
if (mentionSeparators.includes(e.code)) {
if (mentionSeparators.includes(e.code) || e.code === 'Semicolon') {
if (emojiQuery().trim().length === 0) {
setEmojiInput(false);
return false;
@ -263,7 +263,11 @@ const EditBox: Component<{
setEmojiInput(false);
return false;
}
} else if (!['Shift', 'Control', 'Meta'].includes(e.key)) {
return false;
}
if (!['Shift', 'Control', 'Meta'].includes(e.key)) {
setEmojiQuery(q => q + e.key);
return false;
}

View File

@ -464,7 +464,10 @@ const Messages: Component = () => {
return false;
}
if (mentionSeparators.includes(e.code)) {
if (e.code === 'Semicolon') {
}
if (mentionSeparators.includes(e.code) || e.code === 'Semicolon') {
if (emojiQuery().trim().length === 0) {
setEmojiInput(false);
return false;
@ -486,7 +489,11 @@ const Messages: Component = () => {
setEmojiInput(false);
return false;
}
} else if (!['Shift', 'Control', 'Meta'].includes(e.key)) {
return false;
}
if (!['Shift', 'Control', 'Meta'].includes(e.key)) {
setEmojiQuery(q => q + e.key);
return false;
}