fix inline emoji picker
parent
8c5eafccb7
commit
788afc3df7
|
@ -136,8 +136,12 @@ function update_inline_emoji_modal(event)
|
|||
|
||||
// Get current word at string, such as ":marse" or "word"
|
||||
let coords = text.indexOf(' ',box_coords.pos);
|
||||
current_word = /(?:^|\s):[!#a-zA-Z0-9_]+(?=\n|$)/.exec(text.slice(0, coords === -1 ? text.length : coords));
|
||||
if (current_word) current_word = current_word[0].toLowerCase();
|
||||
current_word = /(^|\s):[!#a-zA-Z0-9_]+(?=\n|$)/.exec(text.slice(0, coords === -1 ? text.length : coords));
|
||||
if (current_word) {
|
||||
current_word = current_word[0].toLowerCase();
|
||||
if (current_word.startsWith(' :'))
|
||||
current_word = current_word.substring(1)
|
||||
}
|
||||
|
||||
/* We could also check emoji_typing_state here, which is less accurate but more efficient. I've
|
||||
* kept it unless someone wants to provide an option to toggle it for performance */
|
||||
|
|
Loading…
Reference in New Issue