diff options
Diffstat (limited to 'ui/src/components/comment-form.tsx')
-rw-r--r-- | ui/src/components/comment-form.tsx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ui/src/components/comment-form.tsx b/ui/src/components/comment-form.tsx index 6898ebc7..5239eb2c 100644 --- a/ui/src/components/comment-form.tsx +++ b/ui/src/components/comment-form.tsx @@ -230,11 +230,14 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> { } setupEmojiPicker() { - emojiPicker.on('emoji', emoji => { + emojiPicker.on('emoji', twemojiHtmlStr => { if (this.state.commentForm.content == null) { this.state.commentForm.content = ''; } - let shortName = `:${emojiShortName[emoji]}:`; + var el = document.createElement('div'); + el.innerHTML = twemojiHtmlStr; + let nativeUnicode = (el.childNodes[0] as HTMLElement).getAttribute('alt'); + let shortName = `:${emojiShortName[nativeUnicode]}:`; this.state.commentForm.content += shortName; this.setState(this.state); }); |