You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Close menu after clicking emoji
Signed-off-by: Tulir Asokan <tulir@maunium.net>
This commit is contained in:
@@ -61,6 +61,7 @@ EMOJIBASE.forEach(emoji => {
|
|||||||
class EmojiPicker extends React.Component {
|
class EmojiPicker extends React.Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
onChoose: PropTypes.func.isRequired,
|
onChoose: PropTypes.func.isRequired,
|
||||||
|
closeMenu: PropTypes.func,
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -202,11 +203,11 @@ class EmojiPicker extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onClickEmoji(emoji) {
|
onClickEmoji(emoji) {
|
||||||
this.props.onChoose(emoji.unicode);
|
|
||||||
recent.add(emoji.unicode);
|
recent.add(emoji.unicode);
|
||||||
this.recentlyUsed = recent.get().map(unicode => DATA_BY_EMOJI[unicode]);
|
this.props.onChoose(emoji.unicode);
|
||||||
this.memoizedDataByCategory.recent = this.recentlyUsed.filter(emoji =>
|
if (this.props.closeMenu) {
|
||||||
emoji.filterString.includes(this.state.filter))
|
this.props.closeMenu();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
Reference in New Issue
Block a user