Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MM-57835] In Edit Message Adding emojis in between text while editing a post does not add emojis in the intended place. #26952

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions webapp/channels/src/components/edit_post/edit_post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,10 @@ const EditPost = ({editingPost, actions, canEditPost, config, channelId, draft,
textboxRef.current?.focus();
};

const handleMouseUpKeyUp = (e: React.MouseEvent | React.KeyboardEvent) => {
setCaretPosition((e.target as HTMLInputElement).selectionStart ?? 0);
};

const handleGifClick = (gif: string) => {
let newMessage = gif;

Expand Down Expand Up @@ -518,6 +522,7 @@ const EditPost = ({editingPost, actions, canEditPost, config, channelId, draft,
ref={textboxRef}
characterLimit={rest.maxPostSize}
useChannelMentions={rest.useChannelMentions}
onMouseUp={handleMouseUpKeyUp}
/>
<div className='post-body__actions'>
{emojiPicker}
Expand Down
Loading