From 5e5f36c21668ded94868c8b1b155cb478a1dfed1 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 3 Oct 2017 01:56:50 +0200 Subject: [PATCH] Fix #5079, fix #5186 - Emoji picker fixes (#5187) --- .../components/emoji_picker_dropdown.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.js b/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.js index 7e15c0b40f..b89ce0d87f 100644 --- a/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.js +++ b/app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.js @@ -39,9 +39,8 @@ class ModifierPickerMenu extends React.PureComponent { onClose: PropTypes.func.isRequired, }; - handleClick = (e) => { - const modifier = [].slice.call(e.currentTarget.parentNode.children).indexOf(e.target) + 1; - this.props.onSelect(modifier); + handleClick = e => { + this.props.onSelect(e.currentTarget.getAttribute('data-index') * 1); } componentWillReceiveProps (nextProps) { @@ -81,12 +80,12 @@ class ModifierPickerMenu extends React.PureComponent { return (
- - - - - - + + + + + +
); } @@ -243,6 +242,7 @@ class EmojiPickerMenu extends React.PureComponent { i18n={this.getI18n()} onClick={this.handleClick} skin={modifier} + showPreview={false} backgroundImageFn={backgroundImageFn} />