-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix: resetting the country/state picker when it is reopened #24023
Conversation
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
Looking through FORMS.md, I don't think there's anything that we need to update due to this PR |
const updateSearchValue = useCallback((countries, currentValue) => { | ||
setSearchValue(lodashGet(countries, currentValue, '')); | ||
}, []); | ||
|
||
useEffect(() => { | ||
setSearchValue(lodashGet(allCountries, value, '')); | ||
}, [value, allCountries]); | ||
updateSearchValue(allCountries, value); | ||
}, [value, allCountries, updateSearchValue]); |
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.
Why we are adding updateSearchValue
as a new function? We should just call setSearchValue
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.
Thought it would be DRYer. Will change it.
@joh42 Please adjust the title of the PR to reflect the change. Also please remove the first video showing the bug it may be confusing. |
Updated, ready for another review @s77rt |
Please use the tests described below: (do same thing with state test)
|
👍 updated testing steps @s77rt |
Reviewer Checklist
Screenshots/VideosWebweb.mp4Mobile Web - Chromemweb-chrome.mp4Mobile Web - Safarimweb-safari.mp4Desktopdesktop.mp4iOSios.mp4Androidandroid.mp4 |
Please double check the state selector test steps |
Oh right, you actually don't need to select a country to use the state selector. Removing those 2 steps |
Updated again @s77rt |
@joh42 Thank you! |
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! 🚀
✋ 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/MariaHCD in version: 1.3.50-0 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.50-3 🚀
|
🚀 Deployed to staging by https://github.com/MariaHCD in version: 1.3.51-0 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 1.3.51-2 🚀
|
Details
The values of the country/state pickers would remain cleared after reopening the picker
Please note: the state picker is broken in Storybook due to an issue with HeaderWithBackButton that I have reported here. This issue exists on staging. As suggested by Jack Nam I still marked the Storybook checkbox as completed, since that issue is not caused by this PR.
Fixed Issues
$ #23768
PROPOSAL: #23768 (comment)
Tests
Testing the country selector
Testing the state selector
Offline tests
Same as regular steps
QA Steps
Same as regular steps
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
Web
Screen.Recording.2023-08-02.at.14.31.49.mov
Screen.Recording.2023-08-02.at.14.34.10.mov
Mobile Web - Chrome
Screen.Recording.2023-08-02.at.01.12.32.mov
Mobile Web - Safari
Screen.Recording.2023-08-02.at.00.45.06.mov
Desktop
Screen.Recording.2023-08-02.at.00.33.48.mov
Screen.Recording.2023-08-02.at.00.34.11.mov
iOS
Screen.Recording.2023-08-02.at.00.38.07.mov
Android
Screen.Recording.2023-08-02.at.01.18.23.mov