-
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 #54759] [$500] Description field doesn't autofocus correctly in submit expense flow #52414
Comments
Triggered auto assignment to @sakluger ( |
Job added to Upwork: https://www.upwork.com/jobs/~021856445363759517675 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Description field doesn't autofocus correctly in submit expense flow What is the root cause of that problem?We are trying to set a focus in this code. What changes do you think we should make in order to solve the problem?We can use the
What alternative solutions did you explore? (Optional)We can increase more milliseconds in
Contributor detailsYour Expensify account email: anasup1995@gmail.com |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
Edited by proposal-police: This proposal was edited at 2024-11-20 00:20:18 UTC. ProposalPlease re-state the problem that we are trying to solve in this issueThe field doesn't quite auto-focus. The border turns green as if it was auto-focused, but then in the end you have to tap again to get the cursor to focus into the field. What is the root cause of that problem?The root cause is this What changes do you think we should make in order to solve the problem?
More context on the TextInput What alternative solutions did you explore? (Optional)Add Note I tested the first proposal's suggested solutions and none of them fixed the issue for me. Result videos (before / after)iOS: mWeb Safari
|
Edited by proposal-police: This proposal was edited at 2024-11-13 03:01:54 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Description field doesn't autofocus correctly in submit expense flow What is the root cause of that problem?We set a 300ms timeout in this block to delay the App/src/pages/iou/request/step/IOURequestStepDescription.tsx Lines 79 to 93 in 7256ad6
What changes do you think we should make in order to solve the problem?To resolve this issue, we should use useFocusEffect(
useCallback(() => {
- focusTimeoutRef.current = setTimeout(() => {
+ focusTimeoutRef.current = InteractionManager.runAfterInteractions(() => {
if (inputRef.current) {
inputRef.current.focus();
- }
+ });
return () => {
if (!focusTimeoutRef.current) {
return;
}
clearTimeout(focusTimeoutRef.current);
};
- }, CONST.ANIMATED_TRANSITION);
}, []),
);
What alternative solutions did you explore? (Optional)Alternatively, we can remove this block of code and add // src/pages/iou/request/step/IOURequestStepDescription.tsx#L171
<InputWrapperWithRef
InputComponent={TextInput}
inputID={INPUT_IDS.MONEY_REQUEST_COMMENT}
name={INPUT_IDS.MONEY_REQUEST_COMMENT}
defaultValue={currentDescription}
label={translate('moneyRequestConfirmationList.whatsItFor')}
accessibilityLabel={translate('moneyRequestConfirmationList.whatsItFor')}
role={CONST.ROLE.PRESENTATION}
ref={(el) => {
if (!el) {
return;
}
if (!inputRef.current) {
updateMultilineInputRange(el);
}
inputRef.current = el;
}}
autoGrowHeight
maxAutoGrowHeight={variables.textInputAutoGrowMaxHeight}
shouldSubmitForm
isMarkdownEnabled
excludedMarkdownStyles={!isReportInGroupPolicy ? ['mentionReport'] : []}
+ autoFocus
+ shouldDelayFocus
/> Test branchPOC FOR MAIN SOLUTIONScreen.Recording.2024-11-13.at.09.59.48.movScreen.Recording.2024-11-13.at.10.24.02.movAlternative solutions 2We found that in the app, when there is an InputWrapper with only a single input on the screen, it should automatically focus. If there is more than one input, we shouldn't focus automatically, or we should only focus on the first input.
|
ProposalPlease re-state the problem that we are trying to solve in this issue.The field doesn't quite auto-focus. The border turns green as if it was auto-focused, but then in the end you have to tap again to get the cursor to focus into the field. What is the root cause of that problem?
App/src/pages/iou/request/step/IOURequestStepDescription.tsx Lines 79 to 93 in 7256ad6
It works well in all platform except IOS Safari because of the following:
What changes do you think we should make in order to solve the problem?
to make sure the bug is fixed in safari and does not introduce regression in other platform. What alternative solutions did you explore? (Optional)Optional:
to:
with:
and remove this useEffect |
Hey @getusha, looks like we have several proposals. Could you please take a look? |
Im' going to assign a new C+ to make sure we keep the urgency on this issue. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane ( |
Thanks for the proposal everyone. I believe this issue isn’t limited to the description field. We’ve encountered similar issues in the app before, and I recall we planned to batch them into a single issue. However, it seems they’re still unresolved. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
I found the original issue, but it seems we closed it without resolving. @parasharrajat, since you were reviewing the issue, did we close it in favor of another one? Could you please share some details? |
It was closed after many attempts to fix it. As, I mentioned here #10414 (comment) we should work on fresh issue if needed. |
I've raised the bounty to $500. Hopefully we'll get a few new or updated proposals! |
I think on web it makes sense to handle the autofocus ourselves, as the So I actually agree with this proposal. @ikevin127 mentioned that there is a bug to why the focus isn't working reliably. While I believe this could be true, I would give it a try and see if there isn't anything else going on that might prevents it from working (so I am trying to say: maybe we can make it work 100% of the times, maybe its a bug - I'd have to double check myself). The issue ticket #54759 is primarily for mobile (however it would be nice if wee remove |
@hannojg I believe the issue was that @ikevin127's proposal only addressed the description field - we want to solve this issue for any field that uses auto-focus. Where we got stuck was in figuring out if there was a single component that would fix all auto-focus fields, or if we would need to identify each field and fix it separately. Do you know if there is a single component that would address all auto-focus fields? |
@sakluger, @sobitneupane Whoops! This issue is 2 days overdue. Let's get this updated quick! |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@hannojg checking in again - Do you know if there is a single component that would address all auto-focus fields? |
Here is what I think: There should only be one Right now additionally we have:
So my proposal is, to remove all those workarounds in different places, remove the Thats basically my proposal here: (note: on web this will still require to use some kind of mechanism like
So, my tl;dr: yes, it should be |
Cool, thanks for the feedback! That's super helpful. @sobitneupane @ikevin127 is that helpful for you? |
@sakluger, @sobitneupane Whoops! This issue is 2 days overdue. Let's get this updated quick! |
@sakluger I believe we should hold off on #54759, as it will significantly affect the autofocus logic. @hannojg This issue is reproducible only on iOS/mWeb and occurs across almost every component. The text field appears focused but lacks a caret and keyboard. It has been a long-standing issue. Auto.focus.mp4 |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
As recommended by @sobitneupane, I've put this on hold for #54759 and set it to weekly to align with the priority of the hold issue. |
No new updates in the hold issue. |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.60-1
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @shawnborton
Slack conversation (hyperlinked to channel name): ts_external_expensify_bugs
Action Performed:
Expected Result:
We should auto-focus any text field that is the only text field on the page.
Actual Result:
The description field is the only text field on the page, but the field doesn't quite auto-focus. The border turns green as if it was auto-focused, but you have to tap again to get the cursor to focus in the field.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
RPReplay_Final1731409905.MP4
Auto.focus.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: