Skip to content

Commit

Permalink
fixed bug where mini context menu wouldn't close
Browse files Browse the repository at this point in the history
  • Loading branch information
hannojg committed Mar 6, 2023
1 parent db1026a commit 5e7e7c1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/components/Reactions/MiniQuickEmojiReactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,21 @@ const ICON_SIZE_SCALE_FACTOR = 1.3;

const propTypes = {
...baseQuickEmojiReactionsPropTypes,

/**
* Will be called when the user closed the emoji picker
* without selecting an emoji.
*/
onEmojiPickerClosed: PropTypes.func,

...withLocalizePropTypes,
preferredSkinTone: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,

};

const defaultProps = {
onEmojiPickerClosed: () => {},
...baseQuickEmojiReactionsDefaultProps,
};

/**
Expand All @@ -43,7 +56,7 @@ const MiniQuickEmojiReactions = (props) => {
const openEmojiPicker = () => {
props.onPressOpenPicker();
EmojiPickerAction.showEmojiPicker(
() => {},
props.onEmojiPickerClosed,
(emojiCode, emojiObject) => {
props.onEmojiSelected(emojiObject);
},
Expand Down Expand Up @@ -89,7 +102,7 @@ const MiniQuickEmojiReactions = (props) => {

MiniQuickEmojiReactions.displayName = 'MiniQuickEmojiReactions';
MiniQuickEmojiReactions.propTypes = propTypes;
MiniQuickEmojiReactions.defaultProps = baseQuickEmojiReactionsDefaultProps;
MiniQuickEmojiReactions.defaultProps = defaultProps;
export default compose(
withLocalize,
withOnyx({
Expand Down
1 change: 1 addition & 0 deletions src/pages/home/report/ContextMenu/ContextMenuActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export default [
key="MiniQuickEmojiReactions"
onEmojiSelected={onEmojiSelected}
onPressOpenPicker={keepOpen}
onEmojiPickerClosed={closeContextMenu}
/>
);
}
Expand Down

0 comments on commit 5e7e7c1

Please sign in to comment.