Skip to content

[$250] mWeb/Chrome - Search - Cursor is not moved to the end after selecting for the suggestion #59646

Closed

Description

@IuliiaHerets

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: v9.1.23-2
Reproducible in staging?: Yes
Reproducible in production?: Yes
If this was caught during regression testing, add the test name, ID and link from TestRail: -
Email or phone of affected tester (no customers): applausetester+ds@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: Samsung / Chrome
App Component: Search

Action Performed:

  1. Login to any account with expneses
  2. Navigate to the reports page
    3.In the search bar, type the following: `status: all type: expense from: [The first letters of a user]
  3. Choose from the suggested,

Expected Result:

After selecting from the suggested, the cursor is moved to the end

Actual Result:

After selecting from the suggested, the cursor is not moved to the end. It stays where it was

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6791790_1743727840721.d08488bf-fa82-4e2b-8290-2c505e381142.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021909637145313280933
  • Upwork Job ID: 1909637145313280933
  • Last Price Increase: 2025-04-15
  • Automatic offers:
    • thelullabyy | Contributor | 106953218
Issue OwnerCurrent Issue Owner: @Ollyws

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Apr 4, 2025
  2. melvin-bot commented on Apr 4, 2025

    @melvin-bot

    Triggered auto assignment to @zanyrenney (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. thelullabyy commented on Apr 4, 2025

    @thelullabyy
    Contributor

    🚨 Edited by proposal-police: This proposal was edited at 2025-04-04 08:45:46 UTC.

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    After selecting from the suggested, the cursor is not moved to the end. It stays where it was

    What is the root cause of that problem?

    What changes do you think we should make in order to solve the problem?

    • Should pass selection prop in:
      <SearchInputSelectionWrapper
      value={textInputValue}
      substitutionMap={autocompleteSubstitutions}
      onSearchQueryChange={onSearchQueryChange}
      isFullWidth
      onSubmit={() => {
      KeyboardUtils.dismiss().then(() => submitSearch(textInputValue));
      }}
      autoFocus={false}
      onFocus={onFocus}
      wrapperStyle={{...styles.searchAutocompleteInputResults, ...styles.br2}}
      wrapperFocusedStyle={styles.searchAutocompleteInputResultsFocused}
      rightComponent={inputRightComponent}
      autocompleteListRef={listRef}
      ref={textInputRef}
      />

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    • NA

    What alternative solutions did you explore? (Optional)

  4. ishakakkad commented on Apr 5, 2025

    @ishakakkad
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    After selecting from the suggested, the cursor is not moved to the end. It stays where it was

    What is the root cause of that problem?

    Cursor not moved to end because we are not passing selection props here in SearchInputSelectionWrapper for the smaller screen.

    For the larger screen we already passed the selection props so it is working fine in larger screen.

    ref={textInputRef}
    selection={selection}
    substitutionMap={autocompleteSubstitutions}
    />

    What changes do you think we should make in order to solve the problem?

    To fix this issue we should do following changes.

    1. Pass the selection props in SearchInputSelectionWrapper here

    For ex,

    <SearchInputSelectionWrapper
        value={textInputValue}
        selection={selection}
        substitutionMap={autocompleteSubstitutions}
        onSearchQueryChange={onSearchQueryChange}
        isFullWidth
        onSubmit={() => {
            KeyboardUtils.dismiss().then(() => submitSearch(textInputValue));
        }}
        autoFocus={false}
        onFocus={onFocus}
        wrapperStyle={{...styles.searchAutocompleteInputResults, ...styles.br2}}
        wrapperFocusedStyle={styles.searchAutocompleteInputResultsFocused}
        rightComponent={inputRightComponent}
        autocompleteListRef={listRef}
        ref={textInputRef}
    />
    
    1. For smaller screen we are not updating selection state. So we need to update the selection state when option is selected using keyboard (same as we did for larger screen here) . For this we should replace setTextQuery={setTextInputValue} with setTextQuery={setTextAndUpdateSelection} here

    For ex,

    <SearchAutocompleteList
          autocompleteQueryValue={autocompleteQueryValue}
          searchQueryItem={searchQueryItem}
          onListItemPress={onListItemPress}
          setTextQuery={setTextAndUpdateSelection}
          updateAutocompleteSubstitutions={updateAutocompleteSubstitutions}
          ref={listRef}
      />
    

    Improvement
    Currently text in search field does not move to the end when report name is long. For this I already added proposal here . This both are different issues but still I added here for reference.

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    NA due to UI bug

    What alternative solutions did you explore? (Optional)

  5. melvin-bot commented on Apr 7, 2025

    @melvin-bot

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

  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Apr 8, 2025
  7. changed the title [-]mWeb/Chrome - Search - Cursor is not moved to the end after selecting for the suggestion[/-] [+][$250] mWeb/Chrome - Search - Cursor is not moved to the end after selecting for the suggestion[/+] on Apr 8, 2025
  8. melvin-bot commented on Apr 8, 2025

    @melvin-bot
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Apr 8, 2025
  10. melvin-bot commented on Apr 8, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @Ollyws (External)

  11. 32 remaining items

  12. MarioExpensify commented on May 7, 2025

    @MarioExpensify
    Contributor

    @thelullabyy any news?

  13. Ollyws commented on May 13, 2025

    @Ollyws
    Contributor

    @zanyrenney This one was deployed to production two weeks ago, can we process payment? Thanks!

  14. Ollyws commented on May 19, 2025

    @Ollyws
    Contributor

    BugZero Checklist:

    • [Contributor] Classify the bug:
    Bug classification

    Source of bug:

    • 1a. Result of the original design (eg. a case wasn't considered)
    • 1b. Mistake during implementation
    • 1c. Backend bug
    • 1z. Other:

    Where bug was reported:

    • 2a. Reported on production
    • 2b. Reported on staging (deploy blocker)
    • 2c. Reported on both staging and production
    • 2d. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
    • [Contributor] 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: https://github.com/Expensify/App/pull/56326/files#r2095158581

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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:

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal Template
    • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

      Link to issue:

    Regression Test Proposal

    Precondition:

    Test:

    1. Open the app
    2. Navigate to the reports page
    3. In the search bar, type the following: `status: all type: expense from: [The first letters of a user]
    4. Choose from the suggested
    5. Verify the cursor move to the end of text input
    

    Do we agree 👍 or 👎

  15. Ollyws commented on May 19, 2025

    @Ollyws
    Contributor

    Bump on payment please @zanyrenney

  16. ishakakkad commented on May 22, 2025

    @ishakakkad
    Contributor

    @zanyrenney Could you please review @MarioExpensify comment in the GitHub issue? I was expecting a $75 payment for my contribution as mentioned there. Thanks

  17. MarioExpensify commented on May 22, 2025

    @MarioExpensify
    Contributor

    Bumped @zanyrenney, also let her know about your contribution @ishakakkad.

  18. zanyrenney commented on May 22, 2025

    @zanyrenney
    Contributor

    working on it now.

  19. zanyrenney commented on May 22, 2025

    @zanyrenney
    Contributor

    payment summary

    $ 250 for thelullabyy for the PR implementation - paid via upwork.
    $ 250 for Ollyws as the C+ - please request on ND.
    $ 75 for ishakakkad for helping with the solution - paid $75 on upwork.

  20. zanyrenney commented on May 22, 2025

    @zanyrenney
    Contributor

    @ishakakkad sent you a job offer, please accept: https://www.upwork.com/nx/wm/offer/107409984

  21. ishakakkad commented on May 22, 2025

    @ishakakkad
    Contributor

    Thanks @zanyrenney accepted

  22. Ollyws commented on May 22, 2025

    @Ollyws
    Contributor

    Requested in ND.

  23. zanyrenney commented on May 22, 2025

    @zanyrenney
    Contributor

    payment summary complete, closing!

  24. garrettmknight commented on Jun 3, 2025

    @garrettmknight
    Contributor

    $250 approved for @Ollyws

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions