diff --git a/src/pages/home/report/ReportActionItemMessageEdit.js b/src/pages/home/report/ReportActionItemMessageEdit.js index 3ceaf69b52f5..24ea8c59f545 100644 --- a/src/pages/home/report/ReportActionItemMessageEdit.js +++ b/src/pages/home/report/ReportActionItemMessageEdit.js @@ -205,12 +205,10 @@ function ReportActionItemMessageEdit(props) { } setDraft((prevDraft) => { if (newDraftInput !== newDraft) { - setSelection((prevSelection) => { - const remainder = prevDraft.slice(prevSelection.end).length; - return { - start: newDraft.length - remainder, - end: newDraft.length - remainder, - }; + const remainder = ComposerUtils.getCommonSuffixLength(prevDraft, newDraft); + setSelection({ + start: newDraft.length - remainder, + end: newDraft.length - remainder, }); } return newDraft;