-
Notifications
You must be signed in to change notification settings - Fork 3k
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 2022-11-29] [$250] First field is not focused after clicking the fix the errors link on Connect Manually page reported by @parasharrajat #12400
Comments
Triggered auto assignment to @zanyrenney ( |
Proposal Before : App/src/pages/ReimbursementAccount/BankAccountManualStep.js Lines 36 to 54 in 25c3060
After:
it's because we have set focus on the first errorfield in From.js Lines 230 to 232 in 25c3060
AFfter Fix : Simulator.Screen.Recording.-.iPhone.13.mini.-.2022-11-03.at.17.07.59.mp4 |
Sorry @hungvu193 i'm not clear if you are saying this bug Will be fixed as part of that proposal above, or if that proposal above is a fix for this specific bug? |
@zanyrenney my bad. I misunderstood the description, I deleted it since there was a good proposal above. |
@gadhiyamanan @hungvu193 can we have a solution that doesn't need rearrangement of the if conditions? Because it's really easy to make this bug happen again. |
@rushatgabhane Yeah, we can update the way we focus on field in: Lines 230 to 232 in 25c3060
onFixTheErrorsLinkPressed={() => {
- this.inputRefs[_.first(_.keys(this.state.errors))].focus();
+ this.findFirstError()
}}
findFirstError = () => {
const errorArrays = _.keys(this.state.errors);
const inputArrays = _.keys(this.inputRefs);
let currentFocusKey = null;
_.every(inputArrays, (currentFieldKey) => {
const errorIndex = _.indexOf(errorArrays, currentFieldKey);
if (errorIndex !== -1) {
currentFocusKey = currentFieldKey;
return false;
}
return true;
});
if (currentFocusKey) {
this.inputRefs[currentFocusKey].focus();
}
} Screen.Recording.2022-11-06.at.17.29.05.mov |
Fantastic, that's a great solution! |
There are similar error reported here: #12436 |
ProposalRoot cause: Line 231 in 0724337
This picks first item of errors json. This means focus priority depends on keys sorting in errors. This is incorrect. Focus priority should depend on keys sorting in this.inputRefs <=> views order (from top to bottom) i.e. on Connect bank account page, these are priority order in view: Routing number, Account number, Terms Solution: onFixTheErrorsLinkPressed={() => {
- this.inputRefs[_.first(_.keys(this.state.errors))].focus();
+ const focusKey = _.find(_.keys(this.inputRefs), key => _.keys(this.state.errors).includes(key));
+ this.inputRefs[focusKey].focus();
}} |
@0xmiroslav Nice one. Exactly the way I was thinking (mount order). |
@zanyrenney Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Current assignee @zanyrenney is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Santhosh-Sellavel ( |
Triggered auto assignment to @ctkochan22 ( |
Looks like we have a proposal - @ctkochan22 let me know what you think! Upwork posting is here:https://www.upwork.com/jobs/~01a2007b1a50c1fece |
@hungvu193 @0xmiroslav I tested both of your proposals both are working for the connect manually page. But not working for other pages Screen.Recording.2022-11-09.at.6.31.15.AM.mov |
As I mentioned here, they are using different Form component, I think we have a PR to refactor that already |
@Santhosh-Sellavel I think we don't need care about components that don't use Form yet. There are several form refactoring for components work in progress: These are done: |
Sorry for the delay, @ctkochan22. |
Hmm, I don't see the regression test linked - @ctkochan22 @Santhosh-Sellavel any idea where I'd find that? |
@ctkochan22 bump! |
Added |
@zanyrenney This is due for payment, also the PR is eligible for %50 bonus as it was merged in 3 biz days! |
Thanks for the ping. I almost forgot about it. I think when this issue was solved, %50 bonus was not active. But it could be. |
@parasharrajat Bonus was active on issue hires made after Nov 4. As we can see they are hired on Nov 11 Friday. Merged within the next 3 business days i/e by Nov 16. So it's eligible for a bonus! |
Sorry, was ooo last week on a family emergency. Looks like we need to add a regression test. Looking up how to do that now |
Paid and included Bonus @0xmiroslav |
oops, missed some payments here. Reopening! |
https://www.upwork.com/jobs/~01a2007b1a50c1fece - i need you to apply for the job @parasharrajat @Santhosh-Sellavel so I can pay you. |
@zanyrenney I think you paid $50 more. Can I consider and reduce it in next payment for any job? |
thanks for the catch @0xmiroslav - i'm chatting to my teammate about how best to do this. |
@0xmiroslav our policy is to request the refund through Upwork so we've done that! Lmk any issues or questions please. |
@michaelhaxhiu @zanyrenney refunded |
@Santhosh-Sellavel @parasharrajat - paid! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
Focus should be set on
Routing Number
field.Actual Result:
When all fields are errored, focus is not set on the first field called Routing Number.
Workaround:
unknown
Platform:
Where is this issue occurring?
Version Number: 1.2.22-3
Reproducible in staging?: y
Reproducible in production?: y
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
https://user-images.githubusercontent.com/43996225/199597236-7faabc85-1baf-4b22-ba6c-05bf4aa06abc.mp4
Expensify/Expensify Issue URL:
Issue reported by: @parasharrajat
Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1665921536612629
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: