Skip to content

Commit

Permalink
Chat Autocomplete fill is at the end of msg.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sashank999 committed Mar 29, 2024
1 parent 761a3f0 commit 1afc756
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion extension/changelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1afc756

Please sign in to comment.