improve inline modal

pull/227/head
Aevann 2024-05-22 20:20:03 +03:00
parent 3473f1ee10
commit e2955ff22b
1 changed files with 1 additions and 1 deletions

View File

@ -55,7 +55,7 @@ function close_inline_emoji_modal() {
function replaceText(input, current_word, new_text) {
close_inline_emoji_modal()
const match = new RegExp(current_word+"(?=[^\\w-]|$)", "gi").exec(input.value)
const match = new RegExp(current_word+"(?=[^\\w-]|$)", "gi").exec(input.value.substring(0, input.selectionStart))
if (!match) return
input.focus()
const start_index = match.index;