Closed kavimuru closed 1 year ago
Triggered auto assignment to @zanyrenney (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are β
)I'm not sure if this constitutes a bug, so need to check on this and bring a conversation to bug0.
I guess looking at this again, it is inconsistent so makes sense to progress forward here.
Job added to Upwork: https://www.upwork.com/jobs/~018ed613b675853bc5
Current assignee @zanyrenney is eligible for the External assigner, not assigning anyone new.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (External
)
Triggered auto assignment to @iwiznia (External
), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
In the AddressSearch
component, when we there is a hint present on the input and we enter an address but do not select any recommendation, then when we focus away from the input, the hint is not shown.
We render the hint conditionally to hide it when the suggestions are being shown:
https://github.com/Expensify/App/blob/b3f6dda43f013179fa405948f6262cc54341df1e/src/components/AddressSearch.js#L231
However, when we do not select an address and focus away, the displayListViewBorder
state does not change, thus making the hint not show up.
We need to modify the onBlur
prop passed to GooglePlacesAutocomplete
such that it executes any existing onBlur
prop passed to it and sets the displayListViewBorder
to false.
It is necessary to execute the props.onBlur
because in most components, the AddressSearch
component is a part of the Form.js
. In Form.js
, there exists an onBlur
prop such that when the focus is changed, a validation function is executed. So to fix this issue, we need to execute that function in conjugation with executing the passed onBlur prop.
This can be achieved by creating an inline function which is passed to the onBlur
prop in GooglePlacesAutocomplete
. This function will first check if props.onBlur is a function and if it is, it executes with props.onBlur()
. Then, it executes setDisplayListViewBorder(false);
to set the correct state, allowing for the hint to show back up.
Thanks for your proposal @Prince-Mendiratta
Suggestion text not toggles and shows once we move focus to the other elements without selecting/pressing any suggested option
Currently, onPress of the option from the GooglePlacesAutocomplete
we are setting the displayListViewBorder
to false which shows the hint text. But on blur of the textInput of GooglePlacesAutocomplete
textInputProps we are not setting displayListViewBorder
to false which causes this issue.
We need to update the onBlur inside textInputProps
of the GooglePlacesAutocomplete
with
onBlur: () => setDisplayListViewBorder(false),
https://github.com/Expensify/App/blob/b091e3c747dc39e9642c65199ee31d46b09d81ef/src/components/AddressSearch.js#L213-L236
We are not passing onBlur from the parent for any occurrences so we can take out props.onBlur
.
App does not display hint text under the company address is the user click outside of the dropdown without selecting an option.
In this line https://github.com/Expensify/App/blob/4ee21e95a38858df28e46caf54dc97e1bca9bc7a/src/components/AddressSearch.js#L236, the hint is only displayed if the displayListViewBorder
is false.
The displayListViewBorder
is set to false if the user selects an option, but is not if the user blurs out of the GooglePlacesAutocomplete
.
We need to set the displayListViewBorder
to false when the user blurs the address search input and the option list.
This can be done by updating this line https://github.com/Expensify/App/blob/4ee21e95a38858df28e46caf54dc97e1bca9bc7a/src/components/AddressSearch.js#L241 to
onBlur: (event) => {
if (!(containerRef.current && event.target && containerRef.current.contains(event.relatedTarget))) {
setDisplayListViewBorder(false);
}
props.onBlur(event);
}
The containerRef
is the ref of the address search container (could be this one) that we can set via useRef
.
The related target check is required here because without it, when we select an option, the onBlur
will still trigger, setting displayListViewBorder
to false will make the auto complete component re-render before onPress
is called, making selecting an option
not working.
Currently there's a bug in our react-native-google-places-autocomplete
fork here https://github.com/Expensify/react-native-google-places-autocomplete/blob/e12768f1542e7982d90f6449798f0d6b7f18f192/GooglePlacesAutocomplete.js#L860 that is not passing the event
to onBlur
, we need to fix that as well. The main react-native-google-places-autocomplete
lib already fixed is so we can just update our fork to the latest
setDisplayListViewBorder(false);
inside InteractionManager.runAfterInteractions
as well instead of using related target checkrelatedTarget
check can be added upstream in the library instead of in our codeWorking well after the fix:
@iwiznia, @eVoloshchak, @zanyrenney Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@eVoloshchak can you review the proposals above please?
@Prince-Mendiratta's and @Pujan92's proposals use the same approach: call setDisplayListViewBorder(false)
when GooglePlacesAutocomplete's input is blurred. They both resolve our issue, but as @tienifr's pointed out in their proposal, there is a bug: when we select an option, the onBlur will still trigger, setting displayListViewBorder to false will make the auto-complete component re-render before onPress is called, making selecting an option not working. So essentially you can't select an address
@tienifr's proposal addresses this issue.
We need to set the displayListViewBorder to false inside InteractionManager.runAfterInteractions when the user blurs the address search input and the option list.
Not sure I fully understand, do you propose we use both InteractionManager.runAfterInteractions
and relatedTarget
check or just one of these?
@eVoloshchak sorry for the confusion, either one of these will fix the issue (no need for both), but I prefer to use the relatedTarget check
@eVoloshchak sorry for the confusion, either one of these will fix the issue, but I prefer to use the relatedTarget check
Ok, thanks for the clarification. I agree relatedTarget
check is preferred, we're using the same approach in a couple of components throughout the app.
I think we can proceed with @tienifr's proposal (relatedTarget
check)
πππ C+ reviewed! cc: @iwiznia
Proposal looks good
π£ @tienifr You have been assigned to this job by @iwiznia! Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review π§βπ» Keep in mind: Code of Conduct | Contributing π
Hi @eVoloshchak @iwiznia We need to update react-native-google-places-autocomplete in our fork before. The PR on react-native-google-places-autocomplete fork is ready for review
@iwiznia Friendly bump, could you take a look at 2 PRs on this issue? Thanks
Reviewed the fork and posted in slack to see how we handle the unsigned commits
@iwiznia @zanyrenney I think we need to put this issue on hold until the slack discussion is finished and the rule is removed cc @eVoloshchak
Sounds good. Putting on hold now.
@iwiznia, @eVoloshchak, @zanyrenney, @tienifr Whoops! This issue is 2 days overdue. Let's get this updated quick!
Not overdue We should remove the signed commits requirement in all of the forks soon, which would allow us to merge the PR for this issue
This shouldn't be on HOLD anymore, the first PR was merged, only https://github.com/Expensify/App/pull/16875 is left, currently in review
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.3.6-0 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-05-04. :confetti_ball:
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.
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
Assigned: 2023-04-03 5:01pm On hold until: 2023-04-23 5:04pm Merged: 2023-04-25 7:42pm
Based on the time between it being taken off hold, and it being merged, I think we're π for the 50% urgency bonus
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:
Hi @zanyrenney , @iwiznia , @eVoloshchak ping for payment.
@iwiznia, @eVoloshchak, @zanyrenney, @tienifr Eep! 4 days overdue now. Issues have feelings too...
I was OOO. Catching up now
Currently having an issue on Upwork with the Job posting:
asking for help in bug0 https://expensify.slack.com/archives/C01SKUP7QR0/p1683637396695429
Determine if we should create a regression test for this bug. Is it easy to test for this bug? Yes Is the bug related to an important user flow? (For example, adding a bank account) Yes Is it an impactful bug? No
The bug has a very low impact, but it's easy to test and is related to connect bank account
flow. I think we might want to add a simple regression test
Regression Test Proposal
Do we agree π or π
At Accountex so won't get to this regression test + payout for a few days, reassiging.
Triggered auto assignment to @conorpendergrast (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are β
)Cool I'll get to this today!
@iwiznia Can you give me a sense-check and a π or π on the bonus here? I've ignored the assignment date, and instead I'm working based on the date that this was taken off hold. Dates are here
Offers sent at base rate, will add bonus and pay pending discussion here
Current assignee @conorpendergrast is eligible for the Bug assigner, not assigning anyone new.
Platforms
in OP are β
)Triggered auto assignment to @sophiepintoraetz (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are β
)@sophiepintoraetz Sorry to bring you in on this too Sophie! I am OoO until Monday and in the interest of these payments being overdue, I wanted to make sure they didn't have to wait until then.
Once you and @iwiznia have agreed if the bonuses are due, then the contracts here can be paid. I've already paid the issue reporter!
Yep, agree on bonuses
Ionatan is speedy, so I'm doing the payments. Wrap-up steps are yours, Sophie!
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:
App should display suggestion text below company address if user decides to fill it on their own and not use the suggested addresses
Actual Result:
App does not display suggestion text below company address if user decides to fill it on their own and if suggestions were still displayed before user tries to move to fill in other details
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.2.88-0 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:
https://user-images.githubusercontent.com/43996225/227250842-bc253546-6f19-4bd5-97b1-2778e8171123.mp4
https://user-images.githubusercontent.com/43996225/227250929-6267a11f-4548-4ddf-be78-3398e62e9764.mp4
Expensify/Expensify Issue URL: Issue reported by: @dhanashree-sawant Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1679566976110789
View all open jobs on GitHub
Upwork Automation - Do Not Edit