Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions src/components/EmojiPicker/EmojiPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import calculateAnchorPosition from '@libs/calculateAnchorPosition';
import DomUtils from '@libs/DomUtils';
import {close} from '@userActions/Modal';
import CONST from '@src/CONST';
import KeyboardUtils from '@src/utils/keyboard';
import EmojiPickerMenu from './EmojiPickerMenu';

const DEFAULT_ANCHOR_ORIGIN = {
Expand Down Expand Up @@ -96,22 +97,24 @@ function EmojiPicker({viewportOffsetTop}: EmojiPickerProps, ref: ForwardedRef<Em

// It's possible that the anchor is inside an active modal (e.g., add emoji reaction in report context menu).
// So, we need to get the anchor position first before closing the active modal which will also destroy the anchor.
calculateAnchorPosition(emojiPopoverAnchor?.current, anchorOriginValue).then((value) => {
close(() => {
onWillShow?.();
setIsEmojiPickerVisible(true);
setEmojiPopoverAnchorPosition({
horizontal: value.horizontal,
vertical: value.vertical,
KeyboardUtils.dismiss().then(() =>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding the dismiss for all platforms caused this issue #74593 we fixed it in this PR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method did not work, which caused #78810.

calculateAnchorPosition(emojiPopoverAnchor?.current, anchorOriginValue).then((value) => {
close(() => {
onWillShow?.();
setIsEmojiPickerVisible(true);
setEmojiPopoverAnchorPosition({
horizontal: value.horizontal,
vertical: value.vertical,
});
emojiAnchorDimension.current = {
width: value.width,
height: value.height,
};
setEmojiPopoverAnchorOrigin(anchorOriginValue);
setActiveID(id);
});
emojiAnchorDimension.current = {
width: value.width,
height: value.height,
};
setEmojiPopoverAnchorOrigin(anchorOriginValue);
setActiveID(id);
});
});
}),
);
};

/**
Expand Down
Loading