Added allOptions to scrollToIndex callback dependencies#29848
Added allOptions to scrollToIndex callback dependencies#29848puneetlath merged 11 commits intoExpensify:mainfrom
Conversation
|
@rushatgabhane 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] |
| }, []); | ||
| listRef.current.scrollToLocation({sectionIndex: adjustedSectionIndex, itemIndex, animated, viewOffset: variables.contentHeaderHeight}); | ||
| }, | ||
| [flattenedSections.allOptions, sections], |
There was a problem hiding this comment.
@rushatgabhane Getting below error if we pass only flattenedSections.allOptions to dependencies, so to solve that warning, I've added the sections to the dependencies; not sure if this is a good idea as this line (we would need to make sure that the sections prop is stable in every usage of this component)
suggests we should check if sections are stable in every usage, right now SelectionList is being used at 14 pages.

There was a problem hiding this comment.
@jayeshmangwani can't we exclude sections from the deps? and slap eslint supress on it
// eslint-disable-next-line react-hooks/exhaustive-deps
There was a problem hiding this comment.
@rushatgabhane Thanks for the suggestion. It would also work. I have added disable exhaustive-deps and pushed code.
There was a problem hiding this comment.
@rushatgabhane Applied suggested changes and merged the main branch; please help to review
…ctionList_recompute_on_allOptions
…ctionList_recompute_on_allOptions
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-10-26.at.08.52.05.movMobile Web - SafariScreen.Recording.2023-10-27.at.10.10.15.movDesktopScreen.Recording.2023-10-27.at.10.21.55.moviOSScreen.Recording.2023-10-26.at.09.08.13.movAndroid |
There was a problem hiding this comment.
LGTM!
BTW, my android sim isn't working. others are facing the issue too https://expensify.slack.com/archives/C01GTK53T8Q/p1698287864012389
Let me know if it's ok to merge this PR w/o screenshot for android
|
✋ 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/puneetlath in version: 1.3.93-0 🚀
|
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.3.93-1 🚀
|
|
🚀 Deployed to staging by https://github.com/puneetlath in version: 1.3.94-0 🚀
|
1 similar comment
|
🚀 Deployed to staging by https://github.com/puneetlath in version: 1.3.94-0 🚀
|
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.3.94-2 🚀
|

Details
Fixed Issues
$ #29022
PROPOSAL: #29022 (comment)
Tests
Offline tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)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
Android.1.mp4
Android: mWeb Chrome
mWeb-chrome.mp4
iOS: Native
iOS.mp4
iOS: mWeb Safari
mWeb-safari.mp4
MacOS: Chrome / Safari
web.mp4
MacOS: Desktop
desktop.mov