IOS - Room description input field needs multiple taps before it gets focused
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.73-6 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Yes, reproducible on both If this was caught during regression testing, add the test name, ID and link from TestRail: Exp Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team
Action Performed:
- Open Expensify app
- Create a workspace and a room
- Open room and tap on header
- Tap on Room description
- Tap on room description input field to get it focused
Expected Result:
The room description page gets auto focused and when tapping manually to focus it it does it instantly
Actual Result:
Room description input field becomes unresponsive for a while until it gets focused after multiple taps
Workaround:
Unknown
Platforms:
- [ ] Android: Standalone
- [ ] Android: HybridApp
- [ ] Android: mWeb Chrome
- [x] iOS: Standalone
- [x] iOS: HybridApp
- [ ] iOS: mWeb Safari
- [ ] MacOS: Chrome / Safari
- [ ] MacOS: Desktop
Screenshots/Videos
https://github.com/user-attachments/assets/bf230be1-4b6d-459d-8f3b-5ea7a786ad85
Triggered auto assignment to @muttmuure (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.
Edited by proposal-police: This proposal was edited at 2024-12-10 14:00:36 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
IOS - Room description input field needs multiple taps before it gets focused
What is the root cause of that problem?
- The input is focused twice at the same time, due to which input is not focused correctly and it is causing this issue. https://github.com/Expensify/App/blob/70b92384ba20afcb031f925dac8e7f50b79c4dd0/src/pages/RoomDescriptionPage.tsx#L65-L77 https://github.com/Expensify/App/blob/70b92384ba20afcb031f925dac8e7f50b79c4dd0/src/pages/RoomDescriptionPage.tsx#L114 https://github.com/Expensify/App/blob/70b92384ba20afcb031f925dac8e7f50b79c4dd0/src/libs/updateMultilineInputRange/index.ios.ts#L12-L25
- The immediate focus was added to solve the scroll issue on IOS, but after applying the main solution the scroll behaviour works fine.
What changes do you think we should make in order to solve the problem?
- Pass
falseas the second argument toupdateMultilineInputRange. - We should also identify other similar components and apply the fix there if the same issue occurs.
- Additionally, we can use
useAutoFocusInputinstead of usinguseFocusEffectwith a timeout. - If I recall correctly, the same issue occurred in the
PrivateNotesEditPagecomponent. We will check all components, regardless.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?β¨
What alternative solutions did you explore? (Optional)
- We can update
useFocusEffectcb to not focus for ios devices instead of passing false toupdateMultilineInputRange. We can usegetPlatformfor that.
Result
https://github.com/user-attachments/assets/6ea08e52-0622-4d04-a64d-e3b6f376391c
@muttmuure Huh... This is 4 days overdue. Who can take care of this?
Job added to Upwork: https://www.upwork.com/jobs/~021868754548854947676
Triggered auto assignment to Contributor-plus team member for initial proposal review - @akinwale (External)
Triggered auto assignment to @puneetlath, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
IOS - Room description input field needs multiple taps before it gets focused
- Why does the input require multiple taps to focus?
- This happens because a
TextInputLabelis overlaid on top of the input field, which blocks the tap gesture.
- Why doesnβt the input auto-focus when entering the page?
https://github.com/Expensify/App/blob/1466c022e3bb0ab2ffaaab12f78822a2aca827c8/src/pages/RoomDescriptionPage.tsx#L109-L117 https://github.com/Expensify/App/blob/1466c022e3bb0ab2ffaaab12f78822a2aca827c8/src/libs/updateMultilineInputRange/index.ios.ts#L12-L24 https://github.com/Expensify/App/blob/1466c022e3bb0ab2ffaaab12f78822a2aca827c8/src/components/TextInput/BaseTextInput/index.native.tsx#L102-L116
- We cannot directly call
inputRef.focus()in therefmethod. As noted inBaseTextInput, the correct approach is to useuseEffectcombined with setTimeout to call inputRef.focus() after the component has fully loaded.
What changes do you think we should make in order to solve the problem?
- Add the
pointerEvents="none"inTextInputLabelforAnimated.Text - Replace the
updateMultilineInputRange(el)withupdateMultilineInputRange(el, false)
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We could add UI tests to verify that autoFocus works as expected when the page loads, if applicable
What alternative solutions did you explore? (Optional)
As an optimization, we could leverage BaseTextInput's built-in autoFocus and shouldDelayFocus properties instead of manually calling reportDescriptionInputRef?.current?.focus.
Hello, another proposal might not address the root cause of the issue where the input requires multiple taps to gain focus β€οΈ
π£ @Krishna2323 π An offer has been automatically sent to your Upwork account for the Contributor role π Thanks for contributing to the Expensify app!
Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review π§βπ» Keep in mind: Code of Conduct | Contributing π
@akinwale PR ready for review ^
@akinwale, bump for the review.
Reviewing label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.81-6 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
- https://github.com/Expensify/App/pull/54374
If no regressions arise, payment will be issued on 2025-01-15. :confetti_ball:
For reference, here are some details about the assignees on this issue:
- @akinwale requires payment through NewDot Manual Requests
- @Krishna2323 requires payment automatic offer (Contributor)
@akinwale @muttmuure @akinwale The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
BugZero Checklist:
- [x] [Contributor] Classify the bug:
Bug classification
Source of bug:
- [x] 1a. Result of the original design (eg. a case wasn't considered)
- [ ] 1b. Mistake during implementation
- [ ] 1c. Backend bug
- [ ] 1z. Other:
Where bug was reported:
- [x] 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
- [ ] 2b. Reported on staging (eg. found during regression or PR testing)
- [ ] 2d. Reported on a PR
- [ ] 2z. Other:
Who reported the bug:
- [ ] 3a. Expensify user
- [ ] 3b. Expensify employee
- [ ] 3c. Contributor
- [x] 3d. QA
- [ ] 3z. Other:
-
[x] [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: N/A
-
[x] [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: N/A
-
[x] [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
-
[ ] [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Test:
- Launch Expensify.
- Create a workspace.
- Create a chat room in the workspace.
- Open the newly created chat room and tap on the header.
- Select Room description.
- Verify that the input field is automatically focused.
Do we agree π or π?
@muttmuure bump for payment summary / processing. Thanks.
- @akinwale C+ $250
- @Krishna2323 C $250
@puneetlath, @akinwale, @muttmuure, @Krishna2323 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
$250 approved for @akinwale
@muttmuure, I think I haven't received the payment for this issue. Could you please check? I might be wrong but the Upwork job is still open for me.
^^ can confirm that the offer is accepted but not settled, so I've paid it.