mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-23 15:46:28 +08:00
Require three characters to match :100, :1234 to avoid catching times #1148
This commit is contained in:
parent
fc32702fb8
commit
efcbf996d6
1 changed files with 8 additions and 3 deletions
|
@ -252,10 +252,15 @@ function onKeyUp(event, change, editor) {
|
|||
}
|
||||
let suggestions = [];
|
||||
let picked = emoji.data.get('picked');
|
||||
|
||||
if (typed.length >= 3) {
|
||||
suggestions = getEmojiSuggestions(typed.replace(':', ''));
|
||||
const pickedIdx = suggestions.indexOf(picked);
|
||||
picked = suggestions[pickedIdx === -1 ? 0 : pickedIdx];
|
||||
const typedEmoji = typed.replace(':', '');
|
||||
const isNumeric = `${typedEmoji / 1}` === typedEmoji;
|
||||
if (!isNumeric || typedEmoji.length >= 3) {
|
||||
suggestions = getEmojiSuggestions(typedEmoji);
|
||||
const pickedIdx = suggestions.indexOf(picked);
|
||||
picked = suggestions[pickedIdx === -1 ? 0 : pickedIdx];
|
||||
}
|
||||
}
|
||||
updateEmojiMark(change, emoji, { typed, suggestions, picked });
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue