Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.56k stars 2.9k forks source link

iOS - Composer - No copy paste option in edit mode #49977

Closed IuliiaHerets closed 1 month ago

IuliiaHerets commented 1 month ago

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..42-0 Reproducible in staging?: Y Reproducible in production?: N Email or phone of affected tester (no customers): applausetester+zm27@applause.expensifail.com Issue reported by: Applause Internal Team

Action Performed:

  1. Launch New Expensify app.
  2. Go to DM.
  3. Long tap on any message.
  4. Tap Edit comment.
  5. Tap on the composer to bring up context menu.

Expected Result:

There will be copy paste option in edit mode.

Actual Result:

There is no copy paste option in edit mode.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/3f15d162-7310-4d2a-9a77-85b3361f0ab7

View all open jobs on GitHub

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

github-actions[bot] commented 1 month ago

:wave: 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.
hungvu193 commented 1 month ago

Regression from: https://github.com/Expensify/App/pull/32711

layacat commented 1 month ago

Proposal

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

iOS - Composer - No copy paste option in edit mode

What is the root cause of that problem?

We recently introduce the logic of hiding context menu for Composer text input with contextMenuHidden in https://github.com/Expensify/App/pull/32711

We already implemented it for the main composer however we forgot to implement onTouchStart for the composer of ReportActionItemMessageEdit which makes the showSoftInputOnFocus is always undefined and because of that the condition inside native composer is never called:

    useEffect(() => {
        if (!showSoftInputOnFocus || !isKeyboardShown) {
            return;
        }
        setContextMenuHidden(false);
    }, [showSoftInputOnFocus, isKeyboardShown]);

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

Just implement the logic of onTouchStart for the composer of ReportActionItemMessageEdit too:


     onTouchStart={() => {
                        if (showSoftInputOnFocus) {
                            return;
                        }
                        if (Browser.isMobileSafari()) {
                            setTimeout(() => {
                                setShowSoftInputOnFocus(true);
                            }, CONST.ANIMATED_TRANSITION);
                            return;
                        }
                        setShowSoftInputOnFocus(true);
                    }}

What alternative solutions did you explore? (Optional)

N/A

jasperhuangg commented 1 month ago

Retest request is here for easy access

m-natarajan commented 1 month ago

Issue fixed

https://github.com/user-attachments/assets/b1750cd6-339e-47f2-9be2-0d8f8b0ae523