From 625cfab1b4ea7caed1cd0c17d0c085b14dc674e0 Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Wed, 13 Jan 2021 18:37:07 -0500 Subject: [PATCH] Fixed issue with emoji placement in composer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Fixed: - issue with emoji placement in composer --- app/javascript/gabsocial/components/composer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/javascript/gabsocial/components/composer.js b/app/javascript/gabsocial/components/composer.js index 36e81778..a3cfddaf 100644 --- a/app/javascript/gabsocial/components/composer.js +++ b/app/javascript/gabsocial/components/composer.js @@ -180,7 +180,8 @@ class Composer extends React.PureComponent { const currentBlockIndex = blocks.findIndex((k) => k.key === currentBlockKey) const priorBlockTextLength = blocks.splice(0, currentBlockIndex).map(block => (!block.text.trim() && '') || block.text).join('\n').length const selectionStart = selectionState.getStartOffset() - const cursorPosition = priorBlockTextLength + selectionStart + const toAdd = currentBlockIndex === 0 ? 0 : 1 + const cursorPosition = priorBlockTextLength + selectionStart + toAdd const rawObject = convertToRaw(content) const markdownString = this.props.isPro ? draftToMarkdown(rawObject,markdownOptions) : null