mirror of https://github.com/vector-im/riot-web
Close menu after clicking emoji
Signed-off-by: Tulir Asokan <tulir@maunium.net>pull/21833/head
parent
a6e0986bf8
commit
2dad33cd3e
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue