Skip to content

Commit

Permalink
Merge pull request #27231 from samh-nl/fix/issue-25976
Browse files Browse the repository at this point in the history
fix: use more specific popover anchor
  • Loading branch information
madmax330 authored Sep 13, 2023
2 parents f9f86ea + 9d23ffb commit 7190179
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/components/Reactions/ReportActionItemEmojiReactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const defaultProps = {

function ReportActionItemEmojiReactions(props) {
const {reactionListRef} = useContext(ReportScreenContext);
const popoverReactionListAnchor = useRef(null);
const popoverReactionListAnchors = useRef({});
let totalReactionCount = 0;

// Each emoji is sorted by the oldest timestamp of user reactions so that they will always appear in the same order for everyone
Expand Down Expand Up @@ -95,7 +95,7 @@ function ReportActionItemEmojiReactions(props) {
};

const onReactionListOpen = (event) => {
reactionListRef.current.showReactionList(event, popoverReactionListAnchor.current, reactionEmojiName, props.reportActionID);
reactionListRef.current.showReactionList(event, popoverReactionListAnchors.current[reactionEmojiName], reactionEmojiName, props.reportActionID);
};

return {
Expand All @@ -112,10 +112,7 @@ function ReportActionItemEmojiReactions(props) {

return (
totalReactionCount > 0 && (
<View
ref={popoverReactionListAnchor}
style={[styles.flexRow, styles.flexWrap, styles.gap1, styles.mt2]}
>
<View style={[styles.flexRow, styles.flexWrap, styles.gap1, styles.mt2]}>
{_.map(formattedReactions, (reaction) => {
if (reaction === null) {
return;
Expand All @@ -135,7 +132,7 @@ function ReportActionItemEmojiReactions(props) {
>
<View>
<EmojiReactionBubble
ref={props.forwardedRef}
ref={(ref) => (popoverReactionListAnchors.current[reaction.reactionEmojiName] = ref)}
count={reaction.reactionCount}
emojiCodes={reaction.emojiCodes}
onPress={reaction.onPress}
Expand Down

0 comments on commit 7190179

Please sign in to comment.