Open IuliiaHerets opened 1 day ago
Triggered auto assignment to @strepanier03 (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-11-23 18:08:13 UTC.
Profile - Phone number field is not auto focused
autoFocus
prop is not passed here.
https://github.com/Expensify/App/blob/3ebe8520d74c57a2fe9548b7d4307206e2b7c673/src/pages/settings/Profile/PersonalDetails/PhoneNumberPage.tsx#L96-L111
Pass autoFocus
prop here.
https://github.com/Expensify/App/blob/3ebe8520d74c57a2fe9548b7d4307206e2b7c673/src/pages/settings/Profile/PersonalDetails/PhoneNumberPage.tsx#L96-L111
Additionally we should check on other similar pages and and fix there too.
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
Profile - Phone number field is not auto focused
We are not focusing the input here https://github.com/Expensify/App/blob/3ebe8520d74c57a2fe9548b7d4307206e2b7c673/src/pages/settings/Profile/PersonalDetails/PhoneNumberPage.tsx#L96-L111
We can use useAutoFocusInput
to focus the input same like what we do here
https://github.com/Expensify/App/blob/3ebe8520d74c57a2fe9548b7d4307206e2b7c673/src/pages/GroupChatNameEditPage.tsx#L110
and here
https://github.com/Expensify/App/blob/3ebe8520d74c57a2fe9548b7d4307206e2b7c673/src/pages/iou/request/step/IOURequestStepMerchant.tsx#L136
const {inputCallbackRef} = useAutoFocusInput();
<InputWrapper
InputComponent={TextInput}
inputID={INPUT_IDS.PHONE_NUMBER}
name="lfname"
label={translate('common.phoneNumber')}
aria-label={translate('common.phoneNumber')}
role={CONST.ROLE.PRESENTATION}
defaultValue={phoneNumber}
spellCheck={false}
// inputCallbackRef
ref={inputCallbackRef}
onBlur={() => {
if (!validateLoginError) {
return;
}
PersonalDetails.clearPhoneNumberError();
}}
/>
Profile - Phone number field is not auto focused
We do not handle autofocus for private profile fields such as phone number, legal name, and address.
Address still does not autofocus, but since it uses a different component, we can report and update it later https://github.com/Expensify/App/blob/2c27e6310684fe9cbabf3f1a67291b581be70229/src/components/AddressForm.tsx#L148-L166
To resolve this, we will add autofocus
to enable autofocus and shouldDelayFocus={shouldDelayFocus}
to smoothly open the keyboard on Android as props of InputWrapper
.
autoFocus
shouldDelayFocus={shouldDelayFocus}
autoFocus
shouldDelayFocus={shouldDelayFocus}
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: v9.0.66-0 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers): gibethlehem@gmail.com Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
The phone number field is auto-focused.
Actual Result:
The phone number field is not auto-focused. The same behavior with the Legal name and Address pages.
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Screenshots/Videos
https://github.com/user-attachments/assets/32c5569b-7850-49bb-9339-b29a96c50efd
View all open jobs on GitHub