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

iOS Rules - Text cursor moves to front after entering the third digit in Percentage field #48869

Closed
1 of 6 tasks
IuliiaHerets opened this issue Sep 10, 2024 · 11 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Monthly KSv2 Reviewing Has a PR in review

Comments

@IuliiaHerets
Copy link

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.31-5
Reproducible in staging?: Y
Reproducible in production?: N/A
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team

Action Performed:

  1. Launch New Expensify app.
  2. Go to Workspace settings > Rules.
  3. Enable Auto-approve compliant reports
  4. Tap Random report audit.
  5. Try enter three digits in the input field.

Expected Result:

The text cursor will not move to the front after entering the third digit.

Actual Result:

The text cursor moves to the front after entering the third digit.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6598271_1725941135319.ScreenRecording_09-10-2024_12-02-09_1.mp4

View all open jobs on GitHub

@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Sep 10, 2024
Copy link

melvin-bot bot commented Sep 10, 2024

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

Copy link

melvin-bot bot commented Sep 10, 2024

Triggered auto assignment to @miljakljajic (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 melvin-bot bot added the Daily KSv2 label Sep 10, 2024
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Sep 10, 2024
Copy link
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.

@iwiznia
Copy link
Contributor

iwiznia commented Sep 10, 2024

Since this is only happening in one platform and when you try to enter 3 numbers (which is not really valid), going to remove the blocker.

I think this was added in #47083 which is part of #46935 so maybe @WojtekBoman you want to take a look?

@iwiznia iwiznia added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Sep 10, 2024
@huult
Copy link
Contributor

huult commented Sep 10, 2024

Proposal

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

Text cursor moves to front after entering the third digit in Percentage field

What is the root cause of that problem?

this issue seems to stem from React Native’s handling of inputs on mobile, http://facebook/react-native#36494

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

We can use a workaround (maxLength) to prevent this.

// src/components/PercentageForm.tsx#L71

+    const getMaxLength = useCallback(() => {
+        const numValue = parseInt(currentAmount || "0", 10);
    
+        if ((numValue >= 0 && numValue <= 9) || (numValue >= 11 && numValue <= 99)) {
+           return 2;
+        }
    
+        return 3;
+    }, [currentAmount]);

// src/components/PercentageForm.tsx#L73
      <TextInput
            ...
+         maxLength={getMaxLength()}
POC
Screen.Recording.2024-09-10.at.23.30.44.mp4

@melvin-bot melvin-bot bot added the Overdue label Sep 12, 2024
@iwiznia
Copy link
Contributor

iwiznia commented Sep 13, 2024

@WojtekBoman bump on #48869 (comment)

@melvin-bot melvin-bot bot removed the Overdue label Sep 13, 2024
@WojtekBoman
Copy link
Contributor

Sure I'll take a look, sorry for the delay, I didn't notice the message

@miljakljajic
Copy link
Contributor

Heading out on my parental leave - it seems like this is being handled by @WojtekBoman from software mansion so I will not re-assign another BZ team member. Please add someone else on if I am wrong.

@miljakljajic miljakljajic removed their assignment Sep 20, 2024
@melvin-bot melvin-bot bot removed the Weekly KSv2 label Oct 14, 2024
Copy link

melvin-bot bot commented Oct 14, 2024

This issue has not been updated in over 15 days. @iwiznia, @WojtekBoman 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!

@melvin-bot melvin-bot bot added the Monthly KSv2 label Oct 14, 2024
@Christinadobrzyn
Copy link
Contributor

Christinadobrzyn commented Oct 17, 2024

Hi @WojtekBoman can you tell me if this the fix you're working on might also fix the report here - #50886

@WojtekBoman
Copy link
Contributor

WojtekBoman commented Oct 18, 2024

This issue should be closed, the PR fixing it has already been merged
cc: @iwiznia

@iwiznia iwiznia closed this as completed Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Monthly KSv2 Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

6 participants