Add shouldSyncFocus prop to ListItem components#40234
Add shouldSyncFocus prop to ListItem components#40234roryabraham merged 5 commits intoExpensify:mainfrom
Conversation
Kicu
left a comment
There was a problem hiding this comment.
Seems legit to me - it fixes the problem. I left you small comments
| ) : undefined | ||
| } | ||
| keyForList={item.keyForList} | ||
| onFocus={onFocus} |
There was a problem hiding this comment.
Im not sure what this onFocus is doing?
|
|
||
| // Sync focus on an item | ||
| useSyncFocus(pressableRef, Boolean(isFocused)); | ||
| useSyncFocus(pressableRef, Boolean(isFocused && !shouldPreventFocusSync)); |
There was a problem hiding this comment.
This name is a bit much to parse 😅 I suggest to remove the prevent from name, so that name stays positive - describing what it does, and not negated - which means I need to think more...
First we name it "prevent" but then we have to run ! before it.
I suggest to use a simpler shouldSyncFocus name to use everywhere
roryabraham
left a comment
There was a problem hiding this comment.
code LGTM pending C+ review
Reviewer Checklist
Screenshots/VideosAndroid: NativeCleanShot.2024-04-17.at.03.32.47.mp4Android: mWeb ChromeCleanShot.2024-04-16.at.15.08.45.mp4iOS: NativeCleanShot.2024-04-16.at.06.56.21.mp4iOS: mWeb SafariCleanShot.2024-04-16.at.06.59.59.mp4MacOS: Chrome / SafariCleanShot.2024-04-16.at.06.12.02.mp4MacOS: DesktopCleanShot.2024-04-16.at.06.19.23.mp4 |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
|
helping @fedirjh debug android native build: https://expensify.slack.com/archives/C01GTK53T8Q/p1713282847932119 |
|
@WojtekBoman there are conflicts to resolve here |
fedirjh
left a comment
There was a problem hiding this comment.
Looks good and tests well.
Conflicts resolved :) |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 1.4.63-0 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.63-21 🚀
|
cc: @roryabraham
Details
This PR fixes an issue with losing focus on the text input after typing a letter in SelectionList components.
For example:
Screen.Recording.2024-04-15.at.14.22.15.mov
Fixed Issues
$ #39201 (comment)
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.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.2024-04-15.at.17.05.29.mov
Android: mWeb Chrome
Screen.Recording.2024-04-15.at.17.00.36.mov
iOS: Native
Screen.Recording.2024-04-15.at.18.06.46.mov
iOS: mWeb Safari
Screen.Recording.2024-04-15.at.17.33.54.mov
MacOS: Chrome / Safari
Screen.Recording.2024-04-15.at.16.54.14.mov
MacOS: Desktop
Screen.Recording.2024-04-15.at.16.48.47.mov