Skip to content

Duplicate - The menu doesn't closes immediately after duplicating the expense #78066

Closed

Description

@vincdargento

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: v9.2.82-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #77343
Email or phone of affected tester (no customers): testpayment935@gmail.com
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: Windows 11 pro /Chrome
App Component: Workspace Settings

Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Log in using Track expense option
  3. Go to self DM and create expense
  4. Open the expense and click More
  5. Click Duplicate option

Expected Result:

The menu should closes immediately

Actual Result:

The menu doesn't closes immediately in self DM page and in expanded RHP (expense report page)

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

bug.mp4

View all open jobs on GitHub

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Dec 18, 2025
  2. melvin-bot commented on Dec 18, 2025

    @melvin-bot

    Triggered auto assignment to @brianlee-expensify (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.

  3. melvin-bot commented on Dec 18, 2025

    @melvin-bot

    Triggered auto assignment to @stitesExpensify (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  4. melvin-bot commented on Dec 18, 2025

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  5. github-actions commented on Dec 18, 2025

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  6. nyomanjyotisa commented on Dec 19, 2025

    @nyomanjyotisa
    Member

    Proposal

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

    Duplicate - The menu doesn't closes immediately after duplicating the expense

    What is the root cause of that problem?

    The duplicate action in MoneyRequestHeader has shouldCloseModalOnSelect: false, which prevents the menu from closing after duplicating an expense

    shouldCloseModalOnSelect: false,

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

    I think it's expected to see the menu after duplicating the expense, but if we want to close it immediately, we can remove the shouldCloseModalOnSelect: false prop

    [CONST.REPORT.SECONDARY_ACTIONS.DUPLICATE]: {
    text: isDuplicateActive ? translate('common.duplicate') : translate('common.duplicated'),
    icon: isDuplicateActive ? Expensicons.ReceiptMultiple : Expensicons.CheckmarkCircle,
    value: CONST.REPORT.SECONDARY_ACTIONS.DUPLICATE,
    onSelected: () => {
    if (!isDuplicateActive || !transaction) {
    return;
    }
    temporarilyDisableDuplicateAction();
    duplicateTransaction([transaction]);
    },
    shouldCloseModalOnSelect: false,
    },

    What alternative solutions did you explore? (Optional)

    Create a ref for the ButtonWithDropdownMenu component and use useEffect to close the menu when isDuplicateActive changes from false to true

  7. jjcoffee commented on Dec 19, 2025

    @jjcoffee
    Contributor

    Yes, this is expected for now. The menu should only close immediately in the case of duplicating an expense where there are no other expenses, because in this case we navigate to a different view (this is to handle #77289).

  8. stitesExpensify commented on Dec 19, 2025

    @stitesExpensify
    Contributor

    Okay, since this is expected I'm going to close

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.EngineeringHourlyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions