You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2023-10-16] [HOLD for payment 2023-10-10] [$500] Web - City field is not clear when select another country #28007
Select another country (Make sure the all fields is typed before)
Expected Result:
City field should be clear when select another country
Actual Result:
City field is not clear when select another country
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Android / native
Android / Chrome
iOS / native
iOS / Safari
MacOS / Chrome / Safari
MacOS / Desktop
Version Number: 1.3.72.8 Reproducible in staging?: y Reproducible in production?: y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation
changed the title [-]Web - City field is not clear when select another country[/-][+][$500] Web - City field is not clear when select another country[/+]on Sep 22, 2023
Change in Address Line 1 Behavior: Currently, when changing the address line 1 to an address in the USA, for example, the postcode, city, and state fields are cleared. This behavior is due to the onValueChange handler in the addressline component, where the order in which the values are processed here:
. The city and zip code fields are processed before the country field. Consequently, when the country is changed, it triggers the setCity and setZipCodeas well, setting them to empty strings.
To address this issue, two possible solutions can be considered:
a. Reorder the values list so that the country is on top of the values object, followed by the other fields. This change would prevent the city and zip code from being overridden with empty values.
b. OR Create a custom handler for changing the address line 1, separate from the general address change handler. This custom handler would update only the country field, ensuring that changing the country does not affect the city and zip code.
again it's your choice to add a state for the zip code as well or not .. but it would be useful to reset the zip code as well in case you change the country
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.79-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-10-16. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
External issue reporter
Contributor that fixed the issue
Contributor+ that helped on the issue and/or PR
For reference, here are some details about the assignees on this issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@Ollyws] The PR that introduced the bug has been identified. Link to the PR:
[@Ollyws] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[@Ollyws] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
[@Ollyws] Determine if we should create a regression test for this bug.
[@Ollyws] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@zanyrenney] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
BugZero Checklist:
There's no PR responsible as this wasn't a regression, more of a new feature.
I don't think a regression test is helpful here as it isn't an important flow nor is it very impactful.
Activity
[-]Web - City field is not clear when select another country[/-][+][$500] Web - City field is not clear when select another country[/+]melvin-bot commentedon Sep 22, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01e5128ed81517974f
melvin-bot commentedon Sep 22, 2023
Triggered auto assignment to @michaelhaxhiu (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Sep 22, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅). Is this a valid bug?melvin-bot commentedon Sep 22, 2023
Triggered auto assignment to @zanyrenney (
External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.melvin-bot commentedon Sep 22, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Ollyws (
External)kbecciv commentedon Sep 22, 2023
Proposal by: @DylanDylann
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695197139968609
Proposal
Please re-state the problem that we are trying to solve in this issue.
City field is not clear when select another country
What is the root cause of that problem?
We only use useState for country and state fields because we need to re-set 2 fields when changing country
App/src/pages/settings/Profile/PersonalDetails/AddressPage.js
Lines 119 to 129 in 70e9fa0
I think the city field also should be clear after changing country like state field.
What changes do you think we should make in order to solve the problem?
Firstly, we need to use useState for city field
When country change we need to re-set city to empty like this
and then in here
App/src/pages/settings/Profile/PersonalDetails/AddressPage.js
Line 211 in 70e9fa0
we should use value instead of default value
abzokhattab commentedon Sep 22, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
City field isn't clear when selecting another country
What is the root cause of that problem?
The city is not cleared on changing the country which is handled in
handleAddressChangeApp/src/pages/settings/Profile/PersonalDetails/AddressPage.js
Lines 119 to 129 in 65fd435
What changes do you think we should make in order to solve the problem?
add another state for the city and also the zip code as it make sense to clear the zip code as well on changing the country
and also change the defaultValue property to value and add onChange handle for both the city and the zipcode components:
App/src/pages/settings/Profile/PersonalDetails/AddressPage.js
Line 211 in 65fd435
to
With this change we have to consider two points
App/src/components/AddressSearch/index.js
Lines 206 to 223 in 71db96d
setCityandsetZipCodeas well, setting them to empty strings.To address this issue, two possible solutions can be considered:
a. Reorder the
valueslist so that the country is on top of the values object, followed by the other fields. This change would prevent the city and zip code from being overridden with empty values.b. OR Create a custom handler for changing the address line 1, separate from the general address change handler. This custom handler would update only the country field, ensuring that changing the country does not affect the city and zip code.
And change the
onValueChangehandler for theAddressSearchcomponent of theaddressLine1useEffectmentioned in this issue so that the initial value is always correct: [HOLD for payment 2023-10-10] [$500] Web - Country and State fields are empty if accessed via deep link #27814 (comment)again it's your choice to add a state for the zip code as well or not .. but it would be useful to reset the zip code as well in case you change the country
POC
Screen.Recording.2023-09-23.at.3.56.44.AM.mov
58 remaining items
melvin-bot commentedon Oct 9, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.79-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-10-16. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
melvin-bot commentedon Oct 9, 2023
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
zanyrenney commentedon Oct 12, 2023
4 more days before we can pay this out!
melvin-bot commentedon Oct 16, 2023
@AndrewGable, @Ollyws, @zanyrenney, @DylanDylann Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Ollyws commentedon Oct 16, 2023
BugZero Checklist:
There's no PR responsible as this wasn't a regression, more of a new feature.
I don't think a regression test is helpful here as it isn't an important flow nor is it very impactful.
zanyrenney commentedon Oct 16, 2023
I agree @Ollyws thanks!
zanyrenney commentedon Oct 16, 2023
summary of payments
@Ollyws requires payment offer (Reviewer) - paid $750 ($500 + $250 urgency)
@DylanDylann requires payment offer (Contributor) paid $750 ($500 + $250 urgency)
@DylanDylann requires payment offer (Contributor) - paid $50 reporting bonus
zanyrenney commentedon Oct 16, 2023
all payments are now complete via upwork, closing!