Skip to content

Commit

Permalink
Merge pull request #28297 from neg-0/27195EmojiSpaceFix
Browse files Browse the repository at this point in the history
Fix inconsistent spacing after typing an emoji
  • Loading branch information
youssef-lr authored Oct 2, 2023
2 parents dee1632 + 68fee49 commit 0c866f4
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/pages/home/report/ReportActionItemMessageEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0c866f4

Please sign in to comment.