-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[$125] Taxes - BNP input is not auto focused in add rate page #51543
Comments
Triggered auto assignment to @thienlnam ( |
👋 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:
|
💬 A slack conversation has been started in #expensify-open-source |
Production: RPReplay_Final1730050554.MP4 |
Edited by proposal-police: This proposal was edited at 2024-10-28 15:51:43 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Taxes - BNP input is not auto focused in add rate page What is the root cause of that problem?
App/src/components/AmountPicker/AmountSelectorModal.tsx Lines 42 to 48 in 5103b4b
What changes do you think we should make in order to solve the problem?
// Store the ref of the input
const inputRef = useRef<BaseTextInputRef | null>(null);
const focusTimeoutRef = useRef<NodeJS.Timeout | null>(null);
const inputCallbackRef = (ref: BaseTextInputRef | null) => {
inputRef.current = ref;
};
// use "useFocusEffect" focus on the input whenever "isVisible" state is changed.
useFocusEffect(
useCallback(() => {
focusTimeoutRef.current = setTimeout(() => {
if (inputRef.current && isVisible) {
inputRef.current.focus();
}
return () => {
if (!focusTimeoutRef.current || !isVisible) {
return;
}
clearTimeout(focusTimeoutRef.current);
};
}, CONST.ANIMATED_TRANSITION);
}, [isVisible, inputRef]),
);
// Pass the ref to "AmountForm"
ref={(ref) => inputCallbackRef(ref)}
What alternative solutions did you explore? (Optional)Resulttax_amount_not_focused.mp4 |
But then wouldn't that mean that the issue should be reproducible in prod? |
I'm going to call this NAB - also I don't know if we need it to look "focused" - pressing numbers works fine |
@Beamanator, I tried again to look for a recent PR that might have caused this issue, but I don’t believe any recent PR is responsible—though I may be wrong here. In my opinion, the root cause is the use of the App/src/pages/workspace/rules/RulesMaxExpenseAmountPage.tsx Lines 68 to 75 in 4aa19bf
App/src/pages/workspace/distanceRates/CreateDistanceRatePage.tsx Lines 86 to 92 in 4aa19bf
I think we need to fix this to be consistent will all other similar pages: Inconsistencytax_amount_not_focused_issue.mp4 |
Job added to Upwork: https://www.upwork.com/jobs/~021850971328621900159 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Ollyws ( |
Upwork job price has been updated to $125 |
Reproducible, but also I agree with:
What was the cause here? |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@Ollyws, @thienlnam Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Triggered auto assignment to @garrettmknight ( |
Let's get a fix up at this point - @Ollyws can you review the proposal? |
The root cause is likely from upstream, as this happens only after enabling Bridgeless mode, but adding a delay as @Krishna2323 suggested might be the quickest option for now. |
Ok if we're already using the proposed approach in TextSelectorModal then let's go with @Krishna2323's proposal. 🎀👀🎀 C+ reviewed |
Current assignee @thienlnam is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@garrettmknight, @Ollyws, @thienlnam Huh... This is 4 days overdue. Who can take care of this? |
Hmm, actually we shouldn't be adding setTimeouts here - I'm not sure how that other approach made it into the codebase. That doesn't address the root cause of the issue |
@thienlnam, using setTimeout is very common in cases where we need to focus on the input multiple times when the screen remains open, but a modal is opening and closing (AmountForm is a modal). We even use setTimeout in the useAutoFocusInput hook. App/src/components/ValidateCodeActionModal/ValidateCodeForm/BaseValidateCodeForm.tsx Lines 98 to 133 in 3023d60
App/src/hooks/useAutoFocusInput.ts Lines 41 to 54 in 3023d60
|
We can update this form so it's consistent with the rest, but it's still a workaround. Ideally we'd solve this upstream for all of these cases and remove them, however not something we need to do in this issue |
@garrettmknight, @Ollyws, @thienlnam 6 days overdue. This is scarier than being forced to listen to Vogon poetry! |
@thienlnam can get assigned then? This also requires an effect to focus on input every time we close the amount modal, so that's isn't an an upstream issue. |
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.54-0
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5134453
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
BNP input will be auto focused
Actual Result:
BNP input is not auto focused
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6647125_1730008681078.ScreenRecording_10-27-2024_13-52-22_1.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @OllywsThe text was updated successfully, but these errors were encountered: