Skip to content

Commit

Permalink
prevent focus on composer while emoji picker open and navigating from…
Browse files Browse the repository at this point in the history
… shortcut
  • Loading branch information
situchan committed Mar 22, 2023
1 parent bc927c5 commit f995fd5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/components/EmojiPicker/EmojiPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,19 @@ class EmojiPicker extends React.Component {
}
}

hideEmojiPicker() {
/**
* Hide the emoji picker menu.
*
* @param {Boolean} isNavigating
*/
hideEmojiPicker(isNavigating) {
if (isNavigating) { this.onModalHide = () => {}; }
this.emojiPopoverAnchor = null;
this.setState({isEmojiPickerVisible: false});
}

/**
* Show the ReportActionContextMenu modal popover.
* Show the emoji picker menu.
*
* @param {Function} [onModalHide=() => {}] - Run a callback when Modal hides.
* @param {Function} [onEmojiSelected=() => {}] - Run a callback when Emoji selected.
Expand Down
5 changes: 3 additions & 2 deletions src/libs/actions/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ function setCloseModal(onClose) {
* Close modal in other parts of the app
*
* @param {Function} [onClose]
* @param {Boolean} isNavigating
*/
function close(onClose) {
function close(onClose, isNavigating = true) {
if (!closeModal) {
if (onClose) { onClose(); }
onModalClose = null;
return;
}
onModalClose = onClose;
closeModal();
closeModal(isNavigating);
}

function onModalDidClose() {
Expand Down

0 comments on commit f995fd5

Please sign in to comment.