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
[C+ Checklist Needs Completion] [$1000] The State filled is not cleared after selecting another country #23839
Now click on Country and select a country other than the United States.
Notice that the state filled shows an abbreviation of the previously selected State
Expected Result:
The State filled is cleared
Actual Result:
The State filled is not cleared. Shows abbreviation of previously selected State
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
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.47-3 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
Please re-state the problem that we are trying to solve in this issue.
Currently we are selecting State first (when default Country is US) and then selecting other Country lets say India, then State is not getting empty.
What is the root cause of that problem?
We are not resetting the state input in form when we are changing the country input.
Also even if we update the state component from Picker to TextInput the form's value won't get updated.
Hence showing the previous selected state.
What changes do you think we should make in order to solve the problem?
We can implement a custom formRef which acts like a ref as the below object and it changes values when inputValues or inputRefs changes in Form component:
{ resetField: (inputID) => {... reset the input field} }
We can use this ref in handleAddressChange function of AddressPage component to reset the State input field.
changed the title [-] The State filled is not cleared after selecting another country[/-][+][$1000] The State filled is not cleared after selecting another country[/+]on Jul 31, 2023
changed the title [-][$1000] The State filled is not cleared after selecting another country[/-][+][HOLD for payment 2023-08-17] [$1000] The State filled is not cleared after selecting another country[/+]on Aug 10, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.52-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-08-17. 🎊
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:
@allroundexpertsdoes not require payment (Eligable for Manual Requests)
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:
[@allroundexperts] The PR that introduced the bug has been identified. Link to the PR:
[@allroundexperts] 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:
[@allroundexperts] 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:
[@allroundexperts] Determine if we should create a regression test for this bug.
[@allroundexperts] 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.
[@greg-schroeder] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
changed the title [-][HOLD for payment 2023-08-17] [$1000] The State filled is not cleared after selecting another country[/-][+][HOLD for checklist] [$1000] The State filled is not cleared after selecting another country[/+]on Aug 17, 2023
changed the title [-][HOLD for checklist] [$1000] The State filled is not cleared after selecting another country[/-][+][C+ Checklist Needs Completion] [$1000] The State filled is not cleared after selecting another country[/+]on Aug 17, 2023
Activity
melvin-bot commentedon Jul 28, 2023
Triggered auto assignment to @greg-schroeder (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jul 28, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)jeet-dhandha commentedon Jul 29, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Statefirst (when defaultCountryis US) and then selecting otherCountrylets say India, thenStateis not getting empty.What is the root cause of that problem?
stateinput in form when we are changing thecountryinput.What changes do you think we should make in order to solve the problem?
formRefwhich acts like a ref as the below object and it changes values wheninputValuesorinputRefschanges inFormcomponent:handleAddressChangefunction ofAddressPagecomponent to reset theStateinput field.Form.js Code Reference
When using `Form` in AddressPage.js
const handleAddressChange = (value, key) => { if (key !== 'country') { return; } + if (value !== currentCountry && formRef.current && formRef.current.resetField) { + formRef.current.resetField('state'); + } setCurrentCountry(value); }; ...rest code <Form ...rest + formRef={(ref) => formRef.current = ref} >What alternative solutions did you explore? (Optional)
dukenv0307 commentedon Jul 29, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
The State filled is not cleared after selecting another country
What is the root cause of that problem?
We handle the change of country in
handleAddressChangehere and we only change the country, not clear stateApp/src/pages/settings/Profile/PersonalDetails/AddressPage.js
Lines 118 to 122 in eb02006
What changes do you think we should make in order to solve the problem?
statethe same ascountryonValueChange={handleAddressChange}intoStatePickerandTextInputApp/src/pages/settings/Profile/PersonalDetails/AddressPage.js
Line 182 in eb02006
App/src/pages/settings/Profile/PersonalDetails/AddressPage.js
Line 188 in eb02006
3. Change the default value here to
stateApp/src/pages/settings/Profile/PersonalDetails/AddressPage.js
Line 193 in eb02006
change
defaultValueprop ofTextInputto valueApp/src/pages/settings/Profile/PersonalDetails/AddressPage.js
Line 184 in eb02006
In
handleAddressChangewe check if the key iscountrywe will reset thestateand if the key isstatewe set value to it stateWhat alternative solutions did you explore? (Optional)
greg-schroeder commentedon Jul 31, 2023
Reproduced. Agreed that the state field should just be cleared
[-] The State filled is not cleared after selecting another country[/-][+][$1000] The State filled is not cleared after selecting another country[/+]melvin-bot commentedon Jul 31, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01f0fbcbd5a20b5cfa
melvin-bot commentedon Jul 31, 2023
Current assignee @greg-schroeder is eligible for the External assigner, not assigning anyone new.
40 remaining items
[-][$1000] The State filled is not cleared after selecting another country[/-][+][HOLD for payment 2023-08-17] [$1000] The State filled is not cleared after selecting another country[/+]melvin-bot commentedon Aug 10, 2023
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Aug 10, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.52-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-08-17. 🎊
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 Aug 10, 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:
greg-schroeder commentedon Aug 17, 2023
Issue Participants:
Issue reported by: @daveSeife
Contributor: @dukenv0307
C+: @allroundexperts
Was this issue merged in time to be eligible for the speed bonus? Yes
Were their any regressions? ❌
Payment summary:
Reporter: $250
Contributor: $1,500 ($500 bonus)
C+: $1,500 ($500 bonus)
greg-schroeder commentedon Aug 17, 2023
Please request payment via NewDot @allroundexperts - all that's left here is taking care of the checklist!
[-][HOLD for payment 2023-08-17] [$1000] The State filled is not cleared after selecting another country[/-][+][HOLD for checklist] [$1000] The State filled is not cleared after selecting another country[/+][-][HOLD for checklist] [$1000] The State filled is not cleared after selecting another country[/-][+][C+ Checklist Needs Completion] [$1000] The State filled is not cleared after selecting another country[/+]allroundexperts commentedon Aug 17, 2023
Requested payment in ND. Onto the checklist!
allroundexperts commentedon Aug 20, 2023
Checklist
greg-schroeder commentedon Aug 24, 2023
Filing regression test and closing!
JmillsExpensify commentedon Aug 24, 2023
Reviewed the details for @allroundexperts. $1,500 approved for payment in NewDot based on BZ summary above.