Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use more specific popover anchor #27231

Merged
merged 1 commit into from
Sep 13, 2023
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
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
Loading