Skip to content

[HOLD for payment 2023-07-14] [$1000] Placeholder not moving back to it's place after selecting a contact #19231

Closed

Description

@kavimuru

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:

  1. Click on FAB
  2. Click on "Split bill"
  3. Type an email and select the contact that shows up in the below suggestion
  4. 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

2023-05-16.21.25.47.mp4
Recording.650.mp4

Expensify/Expensify Issue URL:
Issue reported by: @Nathan-Mulugeta
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1684261779675679

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0196a89d054bb9c9e0
  • Upwork Job ID: 1660771960364109824
  • Last Price Increase: 2023-06-12

Activity

  1. added
    Daily
    Bug
    on May 18, 2023
  2. melvin-bot commented on May 18, 2023

    @melvin-bot

    Triggered auto assignment to @strepanier03 (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. melvin-bot commented on May 18, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  4. PrashantMangukiya commented on May 19, 2023

    @PrashantMangukiya
    Contributor

    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

    <OptionsSelector
    canSelectMultipleOptions
    sections={sections}
    selectedOptions={this.props.participants}
    value={this.state.searchTerm}
    onSelectRow={this.toggleOption}
    onChangeText={this.updateOptionsWithSearchTerm}
    headerMessage={headerMessage}
    boldStyle
    shouldShowConfirmButton
    confirmButtonText={this.props.translate('common.next')}
    onConfirmSelection={this.finalizeParticipants}
    textInputLabel={this.props.translate('optionsSelector.nameEmailOrPhoneNumber')}
    safeAreaPaddingBottomStyle={this.props.safeAreaPaddingBottomStyle}
    shouldShowOptions={isOptionsDataReady}
    />

    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.

     <OptionsSelector 
         ....
         shouldFocusOnSelectRow        // *** Add this
     /> 

    This will solve the issue as shown in result video.

    What alternative solutions did you explore? (Optional)

    None

    Result
    SplitBill-Contact-select.mp4
  5. strepanier03 commented on May 19, 2023

    @strepanier03
    Contributor

    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.

  6. strepanier03 commented on May 19, 2023

    @strepanier03
    Contributor

    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??

  7. Nathan-Mulugeta commented on May 19, 2023

    @Nathan-Mulugeta

    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
  8. bernhardoj commented on May 20, 2023

    @bernhardoj
    Contributor

    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:

    // Activate or deactivate the label when value is changed programmatically from outside
    const inputValue = _.isUndefined(this.props.value) ? this.input.value : this.props.value;
    if ((_.isUndefined(inputValue) || this.state.value === inputValue) && _.isEqual(prevProps.selection, this.props.selection)) {
    return;
    }
    // eslint-disable-next-line react/no-did-update-set-state
    this.setState({value: inputValue, selection: this.props.selection});
    // 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();
    } else if (!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.

    deactivateLabel() {
    if (this.props.forceActiveLabel || this.state.value.length !== 0 || this.props.prefixCharacter) {
    return;
    }
    this.animateLabel(styleConst.INACTIVE_LABEL_TRANSLATE_Y, styleConst.INACTIVE_LABEL_SCALE);
    this.isLabelActive = false;
    }

    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.

    if (inputValue) {
    this.activateLabel();
    } else if (!this.state.isFocused) {
    this.deactivateLabel();
    }

    I guess we also can change inputValue to this.state.value instead.

    Result

    Screen.Recording.2023-05-20.at.20.12.56.mov
  9. melvin-bot commented on May 22, 2023

    @melvin-bot

    @strepanier03 Whoops! This issue is 2 days overdue. Let's get this updated quick!

  10. added
    External
    on May 22, 2023
  11. 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
  12. melvin-bot commented on May 22, 2023

    @melvin-bot
  13. 126 remaining items

  14. isabelastisser commented on Jul 18, 2023

    @isabelastisser
    Contributor

    I was OOO yesterday and will take care of this by EOD.

  15. isabelastisser commented on Jul 19, 2023

    @isabelastisser
    Contributor

    @sobitneupane please complete the BugZero checklist.

    I will process the payments in Upwork now.

  16. sobitneupane commented on Jul 20, 2023

    @sobitneupane
    Contributor

    Sorry for the delay @isabelastisser. I will complete the checklist by tomorrow. I will be paid through newDot.

  17. isabelastisser commented on Jul 21, 2023

    @isabelastisser
    Contributor

    The payments were made in Upwork. Waiting for @sobitneupane to complete the BZ checklist, then we are all set.

  18. sobitneupane commented on Jul 24, 2023

    @sobitneupane
    Contributor

    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.

  19. sobitneupane commented on Jul 24, 2023

    @sobitneupane
    Contributor

    Regression Test Proposal

    • Click on FAB
    • Click on "Split bill"
    • Type an email and select the contact that shows up in the below suggestion
    • Verify that the search input is highlighted/selected after user selects/deselects

    Do we agree 👍 or 👎

  20. isabelastisser commented on Jul 24, 2023

    @isabelastisser
    Contributor

    [@isabelastisser] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

    https://github.com/Expensify/Expensify/issues/302474

    all set!

  21. sobitneupane commented on Jul 24, 2023

    @sobitneupane
    Contributor

    #19231 (comment)

    Requested payment on newDot.

  22. JmillsExpensify commented on Jul 27, 2023

    @JmillsExpensify
    Contributor

    @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.

  23. isabelastisser commented on Jul 31, 2023

    @isabelastisser
    Contributor

    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

  24. JmillsExpensify commented on Jul 31, 2023

    @JmillsExpensify
    Contributor

    Reviewed details for @sobitneupane. These details are accurate based on summary from Business Reviewer and are now approved for payment in NewDot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyEngineeringExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions