Repository navigation
Display and Legal name fields are not autofocused when navigated to #60569
Description
Activity
- addedBugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.DailyKSv2KSv2
on Apr 21, 2025 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 2025-04-21 09:32:52 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Display and Legal name fields are not autofocused when navigated to
What is the root cause of that problem?
We are not autofocused text input here
App/src/pages/settings/Profile/DisplayNamePage.tsx
Lines 92 to 102 in 7a42c6a
<InputWrapper InputComponent={TextInput} inputID={INPUT_IDS.FIRST_NAME} name="fname" label={translate('common.firstName')} aria-label={translate('common.firstName')} role={CONST.ROLE.PRESENTATION} defaultValue={currentUserDetails.firstName ?? ''} spellCheck={false} autoCapitalize="words" /> What changes do you think we should make in order to solve the problem?
To fix this issue we need to pass autoFocus here
<InputWrapper InputComponent={TextInput} inputID={INPUT_IDS.FIRST_NAME} name="fname" label={translate('common.firstName')} aria-label={translate('common.firstName')} role={CONST.ROLE.PRESENTATION} defaultValue={currentUserDetails.firstName ?? ''} spellCheck={false} autoCapitalize="words" autoFocus />We haven't passed autofocus here
Same applied for legal name here
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
NA UI BUG
What alternative solutions did you explore? (Optional)
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.
This is expected, we will not focus when there are 2 or more inputs
Reacted by Sheena TrepanierProposal
Please re-state the problem that we are trying to solve in this issue.
- Fields in the display and legal name are not focused
What is the root cause of that problem?
- We don't apply auto focus logic applied in
DisplayNamePageandLegalNamePage.
What changes do you think we should make in order to solve the problem?
- We should add
const {inputCallbackRef} = useAutoFocusInput();to these page. - Then use it in:
<InputWrapper
<InputWrapper
as
ref={inputCallbackRef}.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
- UI bug
What alternative solutions did you explore? (Optional)
@strepanier03 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
@strepanier03 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
Going to close this out as expected behavior and per confirmation from @daledah as well:
This is expected, we will not focus when there are 2 or more inputs
@strepanier03 Could you help check again? In other flows where there are more than 2 inputs, the first one is always auto-focused.
For example, in http://staging.new.expensify.com/new/task/details
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.1.30-0
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: #59087
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Device used: Windows 11/ Chrome, Android 13/ Chrome
App Component: User Settings
Action Performed:
Expected Result:
Fields in display and legal name are autofocused
Actual Result:
Fields in the display and legal name are not focused
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6808243_1745226960399.bandicam_2025-04-21_12-05-10-222.mp4
View all open jobs on GitHub