-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[$1000] selected country does not show on opening Country selection page #23768
Comments
ProposalPlease re-state the problem that we are trying to solve in this issue.Selected country does not show on opening Country selection page What is the root cause of that problem?When we select any country and open the modal again, But when we edit the text input, close the modal, and open it again App/src/components/CountryPicker/index.js Lines 38 to 40 in ac74ab9
And then the text input displays the value that we edited before we closed the modal What changes do you think we should make in order to solve the problem?We should add App/src/components/CountryPicker/index.js Lines 38 to 40 in ac74ab9
We also should check and fix other picker's modals if these have the same problem. What alternative solutions did you explore? (Optional)We also can reset the |
Triggered auto assignment to @dylanexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
Job added to Upwork: https://www.upwork.com/jobs/~019d2209c62f7876f0 |
Current assignee @dylanexpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @s77rt ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.selected country does not show on opening Country selection page What is the root cause of that problem?In AS we have not added App/src/components/CountryPicker/index.js Line 36 in a5373eb
that would only happen if component is remounts. What changes do you think we should make in order to solve the problem?We shall add as mentioned by @s77rt , it will cause un-necessary render, we shall clear the search value when we dismiss the modal. Same can be done for What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.The selected country in the country picker modal remains cleared after closing and reopening it. What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?I suggest we set the search value in App/src/components/CountryPicker/index.js Lines 42 to 44 in b5b730d
I acknowledge that this is similar to other proposed solutions. The difference is that we only run setSearchValue when opening the modal, as opposed to both when opening and closing it.
What alternative solutions did you explore? (Optional) |
@dukenv0307 Thanks for the proposal. Your RCA is about right. The solution makes sense but I think we should avoid adding state variables to // Pattern A
setFoo(5);
setBar(10); // Pattern B
useEffect(() => setBar(10), [foo]);
setFoo(5); Pattern A will result in 1 render while Pattern B will result in 2 renders. We use Pattern B only when we need to setBar after foo is guaranteed to be set. - This is not the case here, we don't need to wait for |
@BhuvaneshPatil Thanks for the proposal. I think it's the same as @dukenv0307's proposal. |
@s77rt To avoid this I think we can remove the useEffect and only set default value when we open the picker. |
@joh42 Thanks for the proposal. Your RCA does not say much but it's actually correct, 🎀 👀 🎀 C+ reviewed |
Triggered auto assignment to @MariaHCD, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@dukenv0307 Thanks for the update but that's actually what @joh42 already suggested. |
@s77rt I think that is an improvement that we can do in the PR. |
If the first solution was useEffect(() => {
...
}, [isPickerVisible]); and the second was useEffect(() => {
if (!isPickerVisible) {
return;
}
...
}, [isPickerVisible]); That would be an optimisation. But in our case the first solution uses |
I just learned that maybe we will refactor the country picker and state picker modal as a single page in this issue #23725. If that happens, maybe this issue will be fixed, so I think we should hold this issue until the refactoring is completed. |
Yep I agree that we should not be refactoring this to two pages unless thats the only possible solution |
📣 @s77rt 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @joh42 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
📣 @gadhiyamanan 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app! |
Thanks! You can expect a PR to be ready for review tomorrow. |
As mentioned by @BhuvaneshPatil, this exact issue is present in the state selector: Screen.Recording.2023-08-01.at.23.44.24.movI'll fix both while I'm at it |
Great work! |
@dylanexpensify No payment is due for me here. Payment will be handled in #17548 as this is a regression. |
@dylanexpensify I got an offer automatically (this is my Upwork profile https://www.upwork.com/freelancers/~01c600f0d690c3dfe1) |
Just to be clear @dylanexpensify, while I'm hired for the Upwork job already, I haven't actually been paid |
Payments sent! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
selected country name should show on opening Country selection page
Actual Result:
selected country does not show on opening Country selection page
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?
Version Number: 1.3.46-1
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
Screen.Recording.2023-07-27.at.12.56.03.PM.mov
Recording.1377.mp4
Expensify/Expensify Issue URL:
Issue reported by: @gadhiyamanan
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690443030366429
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: