-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Fix: Address field shows previous set of results on typing any char after removing the previous text #18258
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
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
|
|
||
| // To avoid regeneration of query object on each re-renders | ||
| const query = useMemo(() => ( | ||
| {language: props.preferredLocale, types: 'address', ...(props.isLimitedToUSA && {components: 'country:us'})} | ||
| ), [props.preferredLocale, props.isLimitedToUSA]); |
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.
| // To avoid regeneration of query object on each re-renders | |
| const query = useMemo(() => ( | |
| {language: props.preferredLocale, types: 'address', ...(props.isLimitedToUSA && {components: 'country:us'})} | |
| ), [props.preferredLocale, props.isLimitedToUSA]); | |
| const query = useMemo(() => ({ | |
| language: props.preferredLocale, | |
| types: 'address', | |
| components: props.isLimitedToUSA ? 'country:us' : undefined, | |
| }), [props.preferredLocale, props.isLimitedToUSA]); |
Just for visibility and I think the comment is not necessary here.
Reviewer Checklist
Screenshots/VideosWebweb.mp4Mobile Web - Chromemweb-chrome.mp4Mobile Web - Safarimweb-safari.mp4Desktopdesktop.mp4iOSios.mp4Androidandroid.mp4 |
|
@Pujan92 Can you please make tests step clearer? Example: type quickly and verify you only see the results of the last typed string or verify you only see results after you are done typing i.e. you should not see intermediate results, etc. (or in any way you see fit better). For Web/Desktop, please indicate that you should check the Network tab and verify that old requests are cancelled once you start typing more letters. Also please remove the offline tests. |
Ok @s77rt , are these steps makes sense?
|
|
@Pujan92 Sorry for the confusion, but by removing the offline tests I meant to keep the title and just write n/a (not applicable). As for the tests please update to:
|
|
@s77rt Thanks! updated with the suggested changes. |
s77rt
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.
LGTM! 🚀
cc @flodnv
flodnv
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.
Lovely, thanks!
|
✋ 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/flodnv in version: 1.3.10-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.12-0 🚀
|
Details
Updated AddressSearch component to use useMemo for the query object which gets passed to the GooglePlacesAutocomplete, with that same ref of query we are passing to the GooglePlacesAutocomplete which eventually won't recreate the function debounceData inside GooglePlacesAutocomplete.
Fixed Issues
$ #16367
PROPOSAL: #16367 (comment)
Tests
Offline Tests
N/A
QA Steps
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
Web
Screen.Recording.2023-05-02.at.12.01.50.PM.mov
Mobile Web - Chrome
Mobile Web - Safari
Desktop
Screen.Recording.2023-05-02.at.12.09.01.PM.mov
iOS
Simulator.Screen.Recording.-.iPhone.14.-.2023-05-02.at.12.05.28.mp4
Android