-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[StatePicker] USA to non USA address should not reset state field value #16466
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
Conversation
Signed-off-by: Prince Mendiratta <prince.mendi@gmail.com>
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
|
@techievivek @rushatgabhane One of you needs to 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] |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-03-25.at.07.39.02.movMobile Web - ChromeScreen.Recording.2023-03-25.at.07.38.36.movMobile Web - SafariScreen.Recording.2023-03-25.at.07.38.12.movDesktopScreen.Recording.2023-03-25.at.07.36.34.moviOSScreen.Recording.2023-03-25.at.07.34.38.movAndroidScreen.Recording.2023-03-25.at.07.34.09.mov |
|
@Prince-Mendiratta in the OP, please mention the exact address one needs to enter to test this PR. |
|
Thanks for the review, @rushatgabhane! Updated tests accordingly 😄 |
rushatgabhane
left a comment
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.
@techievivek LGTM! 🚀
|
Reviewing it today. |
Signed-off-by: Prince Mendiratta <prince.mendi@gmail.com>
|
Quick question: @Prince-Mendiratta, how common is it to restrict the order of the keys during state updates? I am not very convinced that this is the best solution, and maybe the root cause lies within the picker component, as you have mentioned in your alternate solution? |
|
@rushatgabhane Curious to hear your thoughts as well here. |
|
@techievivek
What @rushatgabhane said in #16466 (comment) is accurate. |
|
@techievivek I don't think it's a bug with Picker. I've explained my reasoning on the issue #15633 (comment) I don't think this is a bug with RN-picker-select. It's behaving as expected. If we try to set a value that's not part of the items list, it updates to an empty string (or first item as per docs). The root cause it exactly this. We're trying to set a value that's not part of the picker items list. (docs) @Prince-Mendiratta has a #15633 (comment). And I like it the best even though it's kinda fragile. If we had to fix it in Picker, we'll have to change it so that selecting a value outside of @techievivek What do you think? |
@Prince-Mendiratta not exactly. We went with this approach because I believe it isn't a bug with Picker. |
|
@rushatgabhane right, I was going through the previous discussions and got a bit mixed up. |
|
@Prince-Mendiratta From your proposal From my understanding because we update states(react) one by one |
|
The solution to just update the order of keys looks fine to me for now, thanks. |
yes. Form component loops over it one by one |
|
✋ 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/techievivek in version: 1.2.91-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.2.91-1 🚀
|
Details
With this PR, the issue when we entered a non US address when a USA address has been selected resulted in the state being filled with an empty value has been fixed.
Fixed Issues
$ #15633
PROPOSAL: #15633 (comment)
Tests
Arrivals, choose any USA suggestion)Poligon, choose the Spain address)NOTE: You might see the state being capitalized on it's own but not to worry, that is expected behaviour.
Offline tests
N/A
QA Steps
Same as above
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)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
Web
web.mp4
Mobile Web - Chrome
2023-03-24.08-53-07.mp4
Mobile Web - Safari
ios-safari.mp4
Desktop
desktop.mp4
iOS
ios.mp4
Android
2023-03-24.08-48-45.mp4