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-07-14] [$1000] Placeholder not moving back to it's place after selecting a contact #19231
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor
Type an email and select the contact that shows up in the below suggestion
Notice the placeholder text "Name, email or phone number"
Expected Result:
The placeholder text should return back to it's place after user selects on a contact
Actual Result:
Placeholder stays in typing state and doesn't return back
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.16.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
OptionsSelector has shouldFocusOnSelectRow prop is there with default value false. It can be used to set focus to text input after an option is selected.
/** Whether to focus the textinput after an option is selected */
shouldFocusOnSelectRow: PropTypes.bool,
Within MoneyRequestParticipantsSplitSelector.js we are not passing shouldFocusOnSelectRow props to OptionSelector at line 218, so it will not set focus to text input after option is selected. This is the root cause of the problem.
What changes do you think we should make in order to solve the problem?
Within MoneyRequestParticipantsSplitSelector.js we have to pass shouldFocusOnSelectRow to OptionSelector (starts from line 218) as shown code below. So it will focus to text input after option is selected.
I am able to recreate this behavior, but something odd also happened.
When testing, I recreated the behavior right away. But then I stepped away and left my screen open on the contact select screen where this issue was happening.
When I came back 5-10 minutes later, the behavior didn't happen any longer. The placeholder went back to it's place every time and very quickly. Now, I can't recreate the issue again.
I'm going to pause until tomorrow and then move this forward then if I can recreate.
Yes @strepanier03, I am still able to reproduce this. Here are some things to notice. After clicking split bill from the FAB menu instead of selecting the contact lists from the recent list, type out a new email to add to the split bill money request. After typing the email in the input field select the email that shows up. Then you can notice the place holder doesn't return back to its place. I will attach a video demonestrating this.
// In some cases, When the value prop is empty, it is not properly updated on the TextInput due to its uncontrolled nature, thus manually clearing the TextInput.
if(inputValue===''){
this.input.clear();
}
if(inputValue){
this.activateLabel();
}elseif(!this.state.isFocused){
this.deactivateLabel();
}
As you can see, we update the value state with inputValue and call deactivateLabel if inputValue is empty. Then, inside deactivateLabel, we check if the state of value is empty or not.
If it's empty, then we proceed to deactivate the label. The problem is, the value state is not updated yet inside deactivateLabel, which is basically a race condition.
What changes do you think we should make in order to solve the problem?
Call the deactivateLabel inside the setState callback.
More specific, move this code to be inside the setState callback.
changed the title [-]Placeholder not moving back to it's place after selecting a contact[/-][+][$1000] Placeholder not moving back to it's place after selecting a contact[/+]on May 22, 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:
Rather than a bug, it was an inconsistency issue. The PR raised make MoneyRequestParticipantsSplitSelector page consistent with NewGroupPage.
@isabelastisser Can you please summarize the appropriate individual payments for all parties involved in this issue? This is holding up @sobitneupane's NewDot payments. More information on this compliance process in Slack.
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributor
Activity
melvin-bot commentedon May 18, 2023
Triggered auto assignment to @strepanier03 (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon May 18, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)PrashantMangukiya commentedon May 19, 2023
Proposal
Posting proposal early as per new guidelines
Please re-state the problem that we are trying to solve in this issue.
Placeholder not moving back to it's place after selecting a contact. i.e. Placeholder not focus after selecting contact.
What is the root cause of that problem?
During Split Bill it it rendering participant selection list via this
App/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSplitSelector.js
Lines 218 to 233 in 78ec531
OptionsSelectorhasshouldFocusOnSelectRowprop is there with default value false. It can be used to set focus to text input after an option is selected.App/src/components/OptionsSelector/optionsSelectorPropTypes.js
Lines 71 to 72 in 78ec531
Within
MoneyRequestParticipantsSplitSelector.jswe are not passingshouldFocusOnSelectRowprops toOptionSelectorat line 218, so it will not set focus to text input after option is selected. This is the root cause of the problem.What changes do you think we should make in order to solve the problem?
Within
MoneyRequestParticipantsSplitSelector.jswe have to passshouldFocusOnSelectRowtoOptionSelector(starts from line 218) as shown code below. So it will focus to text input after option is selected.This will solve the issue as shown in result video.
What alternative solutions did you explore? (Optional)
None
Result
SplitBill-Contact-select.mp4
strepanier03 commentedon May 19, 2023
I am able to recreate this behavior, but something odd also happened.
When testing, I recreated the behavior right away. But then I stepped away and left my screen open on the contact select screen where this issue was happening.
When I came back 5-10 minutes later, the behavior didn't happen any longer. The placeholder went back to it's place every time and very quickly. Now, I can't recreate the issue again.
I'm going to pause until tomorrow and then move this forward then if I can recreate.
strepanier03 commentedon May 19, 2023
Tested this again this morning and I the behavior hasn't returned.
@kavimuru, can you still recreate this behavior? I can no longer recreate it. How about you @Nathan-Mulugeta??
Nathan-Mulugeta commentedon May 19, 2023
Yes @strepanier03, I am still able to reproduce this. Here are some things to notice. After clicking split bill from the FAB menu instead of selecting the contact lists from the recent list, type out a new email to add to the split bill money request. After typing the email in the input field select the email that shows up. Then you can notice the place holder doesn't return back to its place. I will attach a video demonestrating this.
2023-05-19.22.13.38.mp4
bernhardoj commentedon May 20, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Text input label does not deactivate (move back as the placeholder) when we clear the input value. To reproduce it, make sure type something first.
What is the root cause of that problem?
Actually, we already have the code that SHOULD deactivate the label when we clear the input value here:
App/src/components/TextInput/BaseTextInput.js
Lines 71 to 89 in 7378626
As you can see, we update the
valuestate withinputValueand calldeactivateLabelifinputValueis empty. Then, insidedeactivateLabel, we check if the state ofvalueis empty or not.App/src/components/TextInput/BaseTextInput.js
Lines 164 to 171 in 7378626
If it's empty, then we proceed to deactivate the label. The problem is, the
valuestate is not updated yet insidedeactivateLabel, which is basically a race condition.What changes do you think we should make in order to solve the problem?
Call the
deactivateLabelinside thesetStatecallback.More specific, move this code to be inside the
setStatecallback.App/src/components/TextInput/BaseTextInput.js
Lines 85 to 89 in 7378626
I guess we also can change
inputValuetothis.state.valueinstead.Result
Screen.Recording.2023-05-20.at.20.12.56.mov
melvin-bot commentedon May 22, 2023
@strepanier03 Whoops! This issue is 2 days overdue. Let's get this updated quick!
[-]Placeholder not moving back to it's place after selecting a contact[/-][+][$1000] Placeholder not moving back to it's place after selecting a contact[/+]melvin-bot commentedon May 22, 2023
Job added to Upwork: https://www.upwork.com/jobs/~0196a89d054bb9c9e0
126 remaining items
isabelastisser commentedon Jul 18, 2023
I was OOO yesterday and will take care of this by EOD.
isabelastisser commentedon Jul 19, 2023
@sobitneupane please complete the BugZero checklist.
I will process the payments in Upwork now.
sobitneupane commentedon Jul 20, 2023
Sorry for the delay @isabelastisser. I will complete the checklist by tomorrow. I will be paid through newDot.
isabelastisser commentedon Jul 21, 2023
The payments were made in Upwork. Waiting for @sobitneupane to complete the BZ checklist, then we are all set.
sobitneupane commentedon Jul 24, 2023
Rather than a bug, it was an inconsistency issue. The PR raised make
MoneyRequestParticipantsSplitSelectorpage consistent with NewGroupPage.sobitneupane commentedon Jul 24, 2023
Regression Test Proposal
Do we agree 👍 or 👎
isabelastisser commentedon Jul 24, 2023
https://github.com/Expensify/Expensify/issues/302474
all set!
sobitneupane commentedon Jul 24, 2023
#19231 (comment)
Requested payment on newDot.
JmillsExpensify commentedon Jul 27, 2023
@isabelastisser Can you please summarize the appropriate individual payments for all parties involved in this issue? This is holding up @sobitneupane's NewDot payments. More information on this compliance process in Slack.
isabelastisser commentedon Jul 31, 2023
Payments summary:
Issue reported by: @Nathan-Mulugeta $250
C+ review: @sobitneupane $1000 review, $500 urgency bonus
Issue fixed by: @dukenv0307, $1000 for accepted proposal, $500 urgency bonus
JmillsExpensify commentedon Jul 31, 2023
Reviewed details for @sobitneupane. These details are accurate based on summary from Business Reviewer and are now approved for payment in NewDot.