Skip to content

Commit

Permalink
fix: fix the bug to keeps the search text (#5225)
Browse files Browse the repository at this point in the history
  • Loading branch information
salihozdemir authored Nov 2, 2023
1 parent e49e7e1 commit 3683ce9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/lib/mention/Mention.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export const Mention = React.memo(

if (currentText.trim() !== selectedText) {
const prevText = value.substring(0, triggerState.index);
const nextText = value.substring(spaceIndex > -1 ? triggerState.index : triggerState.index + currentText.length);
const nextText = value.substring(spaceIndex > -1 ? selectionStart : triggerState.index + currentText.length);

inputRef.current.value = `${prevText}${selectedText} ${nextText}`;
event.target = inputRef.current;
Expand Down

0 comments on commit 3683ce9

Please sign in to comment.