mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-20 11:35:29 +01:00
Fix inserting emojis from emoji picker fails with TypeError (#27647)
This commit is contained in:
parent
277e6968f5
commit
ac8e4ed38d
@ -216,7 +216,7 @@ class ComposeForm extends ImmutablePureComponent {
|
|||||||
|
|
||||||
handleEmojiPick = (data) => {
|
handleEmojiPick = (data) => {
|
||||||
const { text } = this.props;
|
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]);
|
const needsSpace = data.custom && position > 0 && !allowedAroundShortCode.includes(text[position - 1]);
|
||||||
|
|
||||||
this.props.onPickEmoji(position, data, needsSpace);
|
this.props.onPickEmoji(position, data, needsSpace);
|
||||||
|
Loading…
Reference in New Issue
Block a user