Repository navigation
[NOT READY] Workspace - Input field does not auto focus in Distance rates > Add rate page - #69340
Conversation
|
@allroundexperts Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
I noticed that the RCA you mentioned is a little strange to me. I am asking simply for my own information, so that I know how to proceed in the future. Previously, these components did not have autoFocus, and the focus was done through the I suspect that now all places where this hook is used have lost autofocus, given what I wrote above. |
|
@Eskalifer1 You are totally right. Being completely honest here I totally missed this hook and thought that this prop was missing from the beginning. I was being too focused on the prop when I saw it fixing the issue. After initial look into the hook I don't think it's wise to get rid of it, at least for now. It seems to have been added in order to add autoFocus after the component renders so I will have to look into it more, if this hook can work with the new ref handling or if it can be removed. It had to be influenced by my changes made with the refs but I don't yet know how. Thank you a lot ❤️ for your question as I completely missed it and it's a serious issue. I will look into it. |
|
It appears that adding the autoFocus prop isn't the way to go and the issue lays elsewhere so this PR isn't to be merged. I am working on the fix right now and it should resolve all issues of this type. |
Explanation of Change
The issue was caused by a missing
autoFocusprop here:App/src/pages/workspace/distanceRates/CreateDistanceRatePage.tsx
Lines 92 to 99 in d3af0b4
So the whole solution was to just simply add it here.
Fixed Issues
$ #69242
PROPOSAL: N/A
Tests
Offline tests
SAME AS TESTS ^
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
SAME AS TESTS ^
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2025-08-27.at.12.17.41.mov
Android: mWeb Chrome
Screen.Recording.2025-08-27.at.12.36.04.mov
iOS: Native
Screen.Recording.2025-08-27.at.12.41.30.mov
iOS: mWeb Safari
Screen.Recording.2025-08-27.at.12.44.23.mov
MacOS: Chrome / Safari
Screen.Recording.2025-08-27.at.12.14.32.mov
MacOS: Desktop
Screen.Recording.2025-08-27.at.12.49.22.mov