From 2dad33cd3ee66b3157637beec769bfc98f9454c0 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 14 Oct 2019 20:45:17 +0300 Subject: [PATCH] Close menu after clicking emoji Signed-off-by: Tulir Asokan --- src/components/views/emojipicker/EmojiPicker.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/views/emojipicker/EmojiPicker.js b/src/components/views/emojipicker/EmojiPicker.js index 83eb67a6cc..15982e76c1 100644 --- a/src/components/views/emojipicker/EmojiPicker.js +++ b/src/components/views/emojipicker/EmojiPicker.js @@ -61,6 +61,7 @@ EMOJIBASE.forEach(emoji => { class EmojiPicker extends React.Component { static propTypes = { onChoose: PropTypes.func.isRequired, + closeMenu: PropTypes.func, }; constructor(props) { @@ -202,11 +203,11 @@ class EmojiPicker extends React.Component { } onClickEmoji(emoji) { - this.props.onChoose(emoji.unicode); recent.add(emoji.unicode); - this.recentlyUsed = recent.get().map(unicode => DATA_BY_EMOJI[unicode]); - this.memoizedDataByCategory.recent = this.recentlyUsed.filter(emoji => - emoji.filterString.includes(this.state.filter)) + this.props.onChoose(emoji.unicode); + if (this.props.closeMenu) { + this.props.closeMenu(); + } } render() {