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

[HOLD for payment 2024-04-05] [Simplified Collect][Taxes] Android - Workspace - Tax name field isn't auto focused the keyboard isn't visible #38572

Closed
1 of 6 tasks
kbecciv opened this issue Mar 19, 2024 · 27 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Mar 19, 2024

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: 1.4.54.0
Reproducible in staging?: y
Reproducible in production?: n
Issue found when executing PR: #37967
Issue reported by: Applause - Internal team

Action Performed:

Precondition: With a new expensifail account in OD, create a Collect workspace with workspace chat enabled.

  1. In ND, log in with the same account
  2. Navigate to Workspace settings - More features
  3. Enable Taxes
  4. Navigate to Workspace settings - Taxes
  5. Tap on the "+ Add rate" button
  6. Tap on the "Name" field

Expected Result:

The keyboard should be visible.

Actual Result:

Tax name field isn't auto focused, the keyboard isn't visible, only the cursor is shown. The keyboard appears if you tap inside the field.

Workaround:

n/a

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

Add any screenshot/video evidence

Bug6418905_1710834758344.az_recorder_20240319_084531.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01cb504f048b994348
  • Upwork Job ID: 1770073117296906240
  • Last Price Increase: 2024-03-19
  • Automatic offers:
    • alitoshmatov | Reviewer | 0
@kbecciv kbecciv added the DeployBlockerCash This issue or pull request should block deployment label Mar 19, 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.

Copy link

melvin-bot bot commented Mar 19, 2024

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

@kbecciv
Copy link
Author

kbecciv commented Mar 19, 2024

We think that this bug might be related to #wave-collect - Release 1

@Krishna2323
Copy link
Contributor

cc: @luacmartins

@nkdengineer
Copy link
Contributor

nkdengineer commented Mar 19, 2024

Proposal

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

Tax name field isn't auto focused, the keyboard isn't visible, only the cursor is shown. The keyboard appears if you tap inside the field.

What is the root cause of that problem?

We pass autoFocus props into tax name TextInput that makes the cursor appears but the keyboard doesn't appear

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

We should use useAutoFocusInput hook in TextSelectModal and pass the ref as inputCallbackRef here instead of passing autoFocus

What alternative solutions did you explore? (Optional)

NA

@kosmydel
Copy link
Contributor

I think it's a duplicate of this issue: #38497

@nkuoch nkuoch added the External Added to denote the issue can be worked on by a contributor label Mar 19, 2024
@melvin-bot melvin-bot bot changed the title Android - Workspace - Tax name field isn't auto focused the keyboard isn't visible [$500] Android - Workspace - Tax name field isn't auto focused the keyboard isn't visible Mar 19, 2024
Copy link

melvin-bot bot commented Mar 19, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01cb504f048b994348

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 19, 2024
Copy link

melvin-bot bot commented Mar 19, 2024

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

@allgandalf
Copy link
Contributor

c.c. @luacmartins , this seems to be related to taxes

@askavyblr
Copy link

askavyblr commented Mar 19, 2024

Proposal

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

The tax name field lacks auto-focus, rendering the keyboard invisible.

What is the root cause of that problem?

We don't have autofocusing behavior

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

Add autofocusing behavior by using useAutoFocusInput

const {inputCallbackRef} = useAutoFocusInput();

ref={(el) => { inputCallbackRef(el) }} and remove autoFocus

<TextInput
// eslint-disable-next-line react/jsx-props-no-spreading
{...rest}
value={currentValue}
onInputChange={setValue}

What alternative solutions did you explore? (Optional)

N/A

@ahmedGaber93
Copy link
Contributor

ahmedGaber93 commented Mar 19, 2024

Proposal

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

Android - Workspace - Tax name field isn't auto focused the keyboard isn't visible

What is the root cause of that problem?

this a common behaviour in android native when try to focus input while transition is not ended yet.
I think the correct root cause is we don't wait animation to end then focus the input.

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

we should wait transition to end then focus input by those steps.

follow this approech in TextSelectorModal.tsx

const inputRef = useRef<BaseTextInputRef | null>(null);

<Modal
  ...
  onModalShow={() => rest?.autoFocus && inputRef.current?.focus()}
>

   <TextInput
      {...rest}
      autoFocus={false}  // <<<< add this after rest.
      ref={(e) => inputRef.current = e}  // <<<< add this after rest.
   />

</Modal>
result
Screen.Recording.2024-03-19.at.4.00.27.PM.mov

I think this approech keep controlling by prop autoFocus and not remove it.

Important

using useAutoFocusInput will foucs the input only the first time you open modal but if you back then enter the modal again it will not focus.

What alternative solutions did you explore? (Optional)

alternatively we can use useAutoFocusInput (with the limitation i explained above) and pass TextInput autoFocus={false} to prevent override it

<TextInput
  {...rest}
  autoFocus={false}  // <<<< add this after rest.
/>

@luacmartins
Copy link
Contributor

This is not a blocker and something we can address in a follow up to the feature implementation.

@luacmartins luacmartins assigned luacmartins and unassigned nkuoch Mar 19, 2024
@luacmartins luacmartins added Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Mar 19, 2024
@luacmartins
Copy link
Contributor

cc @kosmydel @filip-solecki

@luacmartins luacmartins removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Mar 19, 2024
Copy link

melvin-bot bot commented Mar 20, 2024

📣 @alitoshmatov 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@situchan
Copy link
Contributor

I think this can be handled in #37955.
We're just looking for other pages where this issue happens.
cc: @Krishna2323

@trjExpensify
Copy link
Contributor

Ah, should we hold on #37955 then? Perhaps you could test it with that PR maybe?

@situchan
Copy link
Contributor

This case was not covered on that PR

@luacmartins
Copy link
Contributor

Ok, so we still need this issue. cc @ArekChr since you're assigned to it

@luacmartins
Copy link
Contributor

I'll take this one

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Mar 22, 2024
@ahmedGaber93
Copy link
Contributor

@luacmartins
I think you missed fixing add new rate page (current GitHub issue), and you only fix edit rate page.

@luacmartins
Copy link
Contributor

Thanks @ahmedGaber93! It seems like we were already using autoFocus there so it was working when I tested. I created a PR to make the behavior consistent.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Mar 25, 2024
@melvin-bot melvin-bot bot changed the title [Simplified Collect][Taxes] Android - Workspace - Tax name field isn't auto focused the keyboard isn't visible [HOLD for payment 2024-04-05] [Simplified Collect][Taxes] Android - Workspace - Tax name field isn't auto focused the keyboard isn't visible Mar 29, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Mar 29, 2024
Copy link

melvin-bot bot commented Mar 29, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Mar 29, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.57-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-04-05. 🎊

For reference, here are some details about the assignees on this issue:

@alitoshmatov
Copy link
Contributor

No payment needed for me as C+ reviewer

Copy link

melvin-bot bot commented Apr 5, 2024

Issue is ready for payment but no BZ is assigned. @bfitzexpensify you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!

@luacmartins
Copy link
Contributor

No payment needed. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
No open projects
Archived in project
Development

No branches or pull requests