Open IuliiaHerets opened 3 days ago
Triggered auto assignment to @RachCHopkins (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
@RachCHopkins FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors
When emoji picker is opened, right-clicking on message opens and closes context menu.
We display EmojiPicker
without overlay.
https://github.com/Expensify/App/blob/6d8e739f7b1c286ae65565a6689b27b5983fe48a/src/components/EmojiPicker/EmojiPicker.tsx#L210
withoutOverlay
prop here so user can not directly interact with outside elements when EmojiPicker
is open.
https://github.com/Expensify/App/blob/6d8e739f7b1c286ae65565a6689b27b5983fe48a/src/components/EmojiPicker/EmojiPicker.tsx#L210Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
Right clicking the message when an emoji picker is opened will close the context menu again.
When we right click on a message while the emoji picker is open, it will close the emoji picker before open the context menu. https://github.com/Expensify/App/blob/6d8e739f7b1c286ae65565a6689b27b5983fe48a/src/components/PopoverWithoutOverlay/index.tsx#L52-L56 https://github.com/Expensify/App/blob/6d8e739f7b1c286ae65565a6689b27b5983fe48a/src/components/PopoverProvider/index.tsx#L105-L109
When the emoji picker hide, it will call the popover context close
function, passing the emoji picker anchor ref.
https://github.com/Expensify/App/blob/6d8e739f7b1c286ae65565a6689b27b5983fe48a/src/components/PopoverWithoutOverlay/index.tsx#L58-L62
At this point, the anchor ref is null. It's important to pass the anchor ref to ignore the close call if the active popover anchor ref (context menu anchor ref) is different from the passed anchor ref (emoji picker anchor ref). https://github.com/Expensify/App/blob/6d8e739f7b1c286ae65565a6689b27b5983fe48a/src/components/PopoverProvider/index.tsx#L25-L30
But because the emoji picker anchor ref is null, the logic is passed and activePopoverRef.current.close()
is executed which closes the context menu.
The anchor ref is null because we set it to null when closing the emoji picker. https://github.com/Expensify/App/blob/7981265dc14bc9cb99b512baddbb027446568fcf/src/components/EmojiPicker/EmojiPicker.tsx#L121-L123
However, the real issue here is that, the anchor ref shouldn't be null at all. It should be a ref object, {current: object | null}
. This happens after https://github.com/Expensify/App/pull/37641, a TS migration, specifically updating the getEmojiPopoverAnchor
code.
We need to revert the getEmojiPopoverAnchor
changes to
const getEmojiPopoverAnchor = useCallback(() => emojiPopoverAnchorRef.current ?? emojiPopoverAnchorRef as EmojiPopoverAnchor, []);
Yes, can replicate this.
Job added to Upwork: https://www.upwork.com/jobs/~021843403179458469285
Triggered auto assignment to Contributor-plus team member for initial proposal review - @dukenv0307 (External
)
@bernhardoj's proposal LGTM and tests well
🎀👀🎀 C+ reviewed
Triggered auto assignment to @stitesExpensify, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.45-2 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers): applausetester+pso@applause.expensifail.com Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
Context menu will open.
Actual Result:
Context menu opens then closes.
Workaround:
Unknown
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/4c5a56fb-b356-4233-9cdb-ddf04cdb6f33
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @dukenv0307