From 1afc756d8d0889730dadb1dedb83cecea10ef2db Mon Sep 17 00:00:00 2001 From: Sashank999 Date: Fri, 29 Mar 2024 11:39:30 +0530 Subject: [PATCH] Chat Autocomplete fill is at the end of msg. --- extension/changelog.json | 3 ++- .../scripts/features/chat-autocomplete/ttChatAutocomplete.js | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extension/changelog.json b/extension/changelog.json index 5f86fc95d..f31eaf207 100644 --- a/extension/changelog.json +++ b/extension/changelog.json @@ -9,7 +9,8 @@ { "message": "Fix corruption of stakeouts with reset in Targets page.", "contributor": "TheFoxMan" }, { "message": "Hide Chats feature.", "contributor": "TheFoxMan" }, { "message": "Fix trade values not appearing due to XHR param change.", "contributor": "TheFoxMan" }, - { "message": "Fix Easter Eggs date validation.", "contributor": "TheFoxMan" } + { "message": "Fix Easter Eggs date validation.", "contributor": "TheFoxMan" }, + { "message": "Chat Autocomplete when ping is at the end of message.", "contributor": "TheFoxMan" } ], "changes": [ { "message": "Alert options layout in stakeouts page.", "contributor": "TheFoxMan" }, diff --git a/extension/scripts/features/chat-autocomplete/ttChatAutocomplete.js b/extension/scripts/features/chat-autocomplete/ttChatAutocomplete.js index 6c6144e65..f91f86f49 100644 --- a/extension/scripts/features/chat-autocomplete/ttChatAutocomplete.js +++ b/extension/scripts/features/chat-autocomplete/ttChatAutocomplete.js @@ -67,8 +67,7 @@ currentUsername = matchedUsernames[index]; const valueStart = searchValueMatch.index + searchValueMatch[1].length; - textarea.value = - textarea.value.substring(0, valueStart) + currentUsername + textarea.value.substring(valueBeforeCursor.length, textarea.value.length); + updateReactInput(textarea, textarea.value.substring(0, valueStart) + currentUsername + textarea.value.substring(valueBeforeCursor.length, textarea.value.length), { version: REACT_UPDATE_VERSIONS.DOUBLE_DEFAULT }); const selectionIndex = valueStart + currentUsername.length; textarea.setSelectionRange(selectionIndex, selectionIndex);