-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added allOptions to scrollToIndex callback dependencies #29848
Added allOptions to scrollToIndex callback dependencies #29848
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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