mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-23 23:54:13 +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 suggestions = [];
|
||||||
let picked = emoji.data.get('picked');
|
let picked = emoji.data.get('picked');
|
||||||
|
|
||||||
if (typed.length >= 3) {
|
if (typed.length >= 3) {
|
||||||
suggestions = getEmojiSuggestions(typed.replace(':', ''));
|
const typedEmoji = typed.replace(':', '');
|
||||||
const pickedIdx = suggestions.indexOf(picked);
|
const isNumeric = `${typedEmoji / 1}` === typedEmoji;
|
||||||
picked = suggestions[pickedIdx === -1 ? 0 : pickedIdx];
|
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 });
|
updateEmojiMark(change, emoji, { typed, suggestions, picked });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue