diff options
author | Dessalines <tyhou13@gmx.com> | 2020-04-12 14:55:52 -0400 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2020-04-12 14:55:52 -0400 |
commit | 676690097f0e781dfca2704b1ee88e5a7dfeb91c (patch) | |
tree | d0908103048d6cc026d433b23943b63bb1137088 /ui/src/components/comment-form.tsx | |
parent | a26bff69212ba48bd8a89d7985ccf82d223597d5 (diff) |
Use twemoji style for emoji picker.
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); }); |