Skip to content

Commit 21146e5

Browse files
authored
Merge pull request #24135 from Krishna2323/krishna2323/issue/23751
fix: Wrong position of emoji picker modal
2 parents 1c8f935 + 3a21785 commit 21146e5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/EmojiPicker/EmojiPicker.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const EmojiPicker = forwardRef((props, ref) => {
2828
vertical: 0,
2929
});
3030
const [reportAction, setReportAction] = useState({});
31-
const emojiPopoverAnchorOrigin = useRef(DEFAULT_ANCHOR_ORIGIN);
31+
const [emojiPopoverAnchorOrigin, setEmojiPopoverAnchorOrigin] = useState(DEFAULT_ANCHOR_ORIGIN);
3232
const emojiPopoverAnchor = useRef(null);
3333
const onModalHide = useRef(() => {});
3434
const onEmojiSelected = useRef(() => {});
@@ -58,7 +58,7 @@ const EmojiPicker = forwardRef((props, ref) => {
5858
onWillShow();
5959
setIsEmojiPickerVisible(true);
6060
setEmojiPopoverAnchorPosition(value);
61-
emojiPopoverAnchorOrigin.current = anchorOrigin || DEFAULT_ANCHOR_ORIGIN;
61+
setEmojiPopoverAnchorOrigin(anchorOrigin || DEFAULT_ANCHOR_ORIGIN);
6262
setReportAction(reportActionValue);
6363
});
6464
};
@@ -161,7 +161,7 @@ const EmojiPicker = forwardRef((props, ref) => {
161161
width: CONST.EMOJI_PICKER_SIZE.WIDTH,
162162
height: CONST.EMOJI_PICKER_SIZE.HEIGHT,
163163
}}
164-
anchorAlignment={emojiPopoverAnchorOrigin.current}
164+
anchorAlignment={emojiPopoverAnchorOrigin}
165165
outerStyle={StyleUtils.getOuterModalStyle(props.windowHeight, props.viewportOffsetTop)}
166166
innerContainerStyle={styles.popoverInnerContainer}
167167
avoidKeyboard

0 commit comments

Comments
 (0)