From ac8e4ed38db2f391f7f8749a8e3afe265deeae72 Mon Sep 17 00:00:00 2001 From: mogaminsk Date: Wed, 1 Nov 2023 16:22:02 +0900 Subject: [PATCH] Fix inserting emojis from emoji picker fails with TypeError (#27647) --- .../mastodon/features/compose/components/compose_form.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/mastodon/features/compose/components/compose_form.jsx b/app/javascript/mastodon/features/compose/components/compose_form.jsx index a59a8a70b..b15fe2909 100644 --- a/app/javascript/mastodon/features/compose/components/compose_form.jsx +++ b/app/javascript/mastodon/features/compose/components/compose_form.jsx @@ -216,7 +216,7 @@ class ComposeForm extends ImmutablePureComponent { handleEmojiPick = (data) => { const { text } = this.props; - const position = this.textarea.selectionStart; + const position = this.textareaRef.current.selectionStart; const needsSpace = data.custom && position > 0 && !allowedAroundShortCode.includes(text[position - 1]); this.props.onPickEmoji(position, data, needsSpace);