Skip to content

[HOLD for payment 2023-12-13][$500] Mention(@) and emoji(:) popup does not close when dragging a file #30153

Closed

Description

@kbecciv

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: 1.3.88.1
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @daveSeife
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1697872753258699

Action Performed:

  1. Open any Chat
  2. Write @ or : and any emoji name, While the popup is open Drag a file onto the chat
    Notice the popup does not dismiss

Expected Result:

Popup closes when dragging a file

Actual Result:

Popup does not close when dragging a file

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
t4popupDragingFile.MacChrome.mp4
Recording.5106.mp4
MacOS: Desktop
t4PupupDragingfile.MacDesktop.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ebdf425a95b3b890
  • Upwork Job ID: 1716273483340058624
  • Last Price Increase: 2023-10-30
  • Automatic offers:
    • cubuspl42 | Reviewer | 27579707
    • ishpaul777 | Contributor | 27579709
    • daveSeife | Reporter | 27579710

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 23, 2023
  2. changed the title [-] Mention(@) and emoji(:) popup does not close when dragging a file[/-] [+][$500] Mention(@) and emoji(:) popup does not close when dragging a file[/+] on Oct 23, 2023
  3. melvin-bot commented on Oct 23, 2023

    @melvin-bot
  4. melvin-bot commented on Oct 23, 2023

    @melvin-bot

    Triggered auto assignment to @sonialiap (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  5. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Oct 23, 2023
  6. melvin-bot commented on Oct 23, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  7. melvin-bot commented on Oct 23, 2023

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @cubuspl42 (External)

  8. dummy-1111 commented on Oct 23, 2023

    @dummy-1111
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Suggestions popup doesn't close when dragging a file

    What is the root cause of that problem?

    We do nothing to close suggestions popup when dragging a file

    What changes do you think we should make in order to solve the problem?

    1. Change the updateShouldShowSuggestionMenuToFalse function to receive shouldShow argument
      Update
      const updateShouldShowSuggestionMenuToFalse = useCallback(() => {
      setSuggestionValues((prevState) => {
      if (prevState.shouldShowSuggestionMenu) {
      return {...prevState, shouldShowSuggestionMenu: false};
      }
      return prevState;
      });
      }, []);

      const updateShouldShowSuggestionMenuToFalse = useCallback(() => {
      setSuggestionValues((prevState) => {
      if (prevState.shouldShowSuggestionMenu) {
      return {...prevState, shouldShowSuggestionMenu: false};
      }
      return prevState;
      });
      }, []);

    to

        const updateShouldShowSuggestionMenuToFalse = useCallback((shouldShow) => {
            setSuggestionValues((prevState) => {
                if (prevState.shouldShowSuggestionMenu !== shouldShow) {
                    return {...prevState, shouldShowSuggestionMenu: shouldShow};
                }
                return prevState;
            });
        }, []);
    
    1. Update
      const updateShouldShowSuggestionMenuToFalse = useCallback(() => {
      suggestionEmojiRef.current.updateShouldShowSuggestionMenuToFalse();
      suggestionMentionRef.current.updateShouldShowSuggestionMenuToFalse();
      }, []);

      to
        const updateShouldShowSuggestionMenuToFalse = useCallback((shouldShow = false) => {
            suggestionEmojiRef.current.updateShouldShowSuggestionMenuToFalse(shouldShow);
            suggestionMentionRef.current.updateShouldShowSuggestionMenuToFalse(shouldShow);
        }, []);
    
    1. Add the following code to Suggestions
        const {isDraggingOver} = useContext(DragAndDropContext);
    
        ...
        useEffect(() => {
            updateShouldShowSuggestionMenuToFalse(!isDraggingOver);
        }, [isDraggingOver])
    

    This works as expected

    Result
    30153.mp4

    What alternative solutions did you explore? (Optional)

  9. c3024 commented on Oct 23, 2023

    @c3024
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Mention and emoji suggestions appear over the drop screen when dragging a file on to the composer with suggestions open.

    What is the root cause of that problem?

    I think the expected behaviour should be not necessarily to close the suggestions popup. Instead we want the 'Drop to Upload' screen to be over the suggestions popup.

    We are using this host here to show suggestions.


    Suggestions are wrapped inside Portal with this host name here
    <Portal hostName="suggestions">
    {/* eslint-disable-next-line react/jsx-props-no-spreading */}
    <BaseAutoCompleteSuggestions {...props} />
    </Portal>

    but here we are porting it to the body
    ReactDOM.createPortal(<View style={StyleUtils.getBaseAutoCompleteSuggestionContainerStyle({left, width, bottom})}>{componentToRender}</View>, document.querySelector('body'))

    so the suggestions popover appears over the "Drop to Upload" screen.

    What changes do you think we should make in order to solve the problem?

    I think we should remove createPortal in the return of index.js of AutoCompleteSuggestions specified above and wrap the View with Portal like this

    <Portal hostName="suggestions"><View style={StyleUtils.getBaseAutoCompleteSuggestionContainerStyle({left, width, bottom})}>{componentToRender}</View></Portal>

    What alternative solutions did you explore? (Optional)

    We might wrap the BaseAutoCompleteSuggestions with Portal and remove createPortal in the index.js of AutoCompleteSuggestions specified above.
    With this change, the componentToRender and return of index.js of AutoCompleteSuggestions will be something like this.

    const componentToRender = (
            <Portal hostName="suggestions">
              <BaseAutoCompleteSuggestions
                  // eslint-disable-next-line react/jsx-props-no-spreading
                  {...props}
                  ref={containerRef}
              />
            </Portal>
        );
    
        return (
            Boolean(width) &&
            <View style={StyleUtils.getBaseAutoCompleteSuggestionContainerStyle({left, width, bottom})}>{componentToRender}</View>
        );
    Result
    Screen.Recording.2023-10-23.at.12.29.59.PM.mov
  10. jakub-trzebiatowski commented on Oct 23, 2023

    @jakub-trzebiatowski
    Contributor

    @s-alves10 Would you publish your branch?

  11. c3024 commented on Oct 23, 2023

    @c3024
    Contributor

    @cubuspl42

    Is the suggestions popup closing the expected behaviour?

    I think it need not close. In my opinion, the expected behaviour should be that the drop screen should be over the suggestions popup.

  12. 42 remaining items

  13. DylanDylann commented on Nov 23, 2023

    @DylanDylann
    Contributor

    @sonialiap I reported this bug before here #27564. Could you help to update reporter on the OP

  14. melvin-bot commented on Dec 5, 2023

    @melvin-bot

    This issue has not been updated in over 15 days. @cubuspl42, @joelbettner, @sonialiap, @ishpaul777 eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  15. jakub-trzebiatowski commented on Dec 6, 2023

    @jakub-trzebiatowski
    Contributor

    PR is merged

  16. sonialiap commented on Dec 15, 2023

    @sonialiap
    Contributor

    Automation didn't run. The PR went to production on Dec 6, updating issue title to payment on Dec 13 and making payments

  17. changed the title [-][$500] Mention(@) and emoji(:) popup does not close when dragging a file[/-] [+][HOLD for payment 2023-12-13][$500] Mention(@) and emoji(:) popup does not close when dragging a file[/+] on Dec 15, 2023
  18. sonialiap commented on Dec 18, 2023

    @sonialiap
    Contributor

    @ishpaul777 contributor $500 paid ✔️
    @cubuspl42 reviewer $500 paid ✔️
    @DylanDylann bug report $50 - paid ✔️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions