Fix inserting emojis from emoji picker fails with TypeError (#27647)

pull/2517/head
mogaminsk 2023-11-01 16:22:02 +09:00 committed by GitHub
parent 277e6968f5
commit ac8e4ed38d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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);