Skip to content

[HOLD for payment 2024-01-02] [$500] Web - Search - Selected dropdown item with tab key is not opened in Search #32388

Closed

Description

@lanitochka17

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: 1.4.7-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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Login to ND Expensify
  2. Press CTRL+K or click Magnifying glass icon
  3. Select any dropdown item with Tab key
  4. Press Enter key

Expected Result:

Items in search dropdown should be selected consistently both with up&down and tab keys, and the correct one is opened after pressing Enter key

Actual Result:

Highlighted item (default first one) with Up&Down keys is opened instead of blue bordered item which is selected with Tab key

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • Windows: Chrome
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6297806_1701459856402.2023-12-01_20-58-59.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015640f29df912d30c
  • Upwork Job ID: 1730709594365632512
  • Last Price Increase: 2023-12-01
  • Automatic offers:
    • alitoshmatov | Reviewer | 28062509
    • DylanDylann | Contributor | 28062510

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Dec 1, 2023
  2. changed the title [-]Web - Search - Selected dropdown item with tab key is not opened in Search[/-] [+][$500] Web - Search - Selected dropdown item with tab key is not opened in Search[/+] on Dec 1, 2023
  3. melvin-bot commented on Dec 1, 2023

    @melvin-bot
  4. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Dec 1, 2023
  5. melvin-bot commented on Dec 1, 2023

    @melvin-bot

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

  6. melvin-bot commented on Dec 1, 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
  7. melvin-bot commented on Dec 1, 2023

    @melvin-bot

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

  8. unidev727 commented on Dec 1, 2023

    @unidev727
    Contributor

    Proposal

    from: @unicorndev-727

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

    Highlighted item (default first one) with Up&Down keys is opened instead of blue bordered item which is selected with Tab key

    What is the root cause of that problem?

    The root cause is that the pressOnEnter is set on Confirm button and it's priority is 1 so when we click enter, the button is pressed first with highlighted item.

    <Button
    success
    style={[this.props.themeStyles.w100]}
    text={defaultConfirmButtonText}
    onPress={this.props.onConfirmSelection}
    pressOnEnter
    enterKeyEventListenerPriority={1}

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

    we need to adjust button's priority here or can change the default item when we select other item using tab.

    What alternative solutions did you explore? (Optional)

    N/A

  9. DylanDylann commented on Dec 2, 2023

    @DylanDylann
    Contributor

    Proposal

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

    • Web - Search - Selected dropdown item with tab key is not opened in Search

    What is the root cause of that problem?

    • We're selecting the row based on highlighted item, and we don't consider the blue focus one
      selectFocusedOption() {
      const focusedOption = this.state.allOptions[this.state.focusedIndex];
      if (!focusedOption || !this.props.isFocused) {
      return;
      }
      if (this.props.canSelectMultipleOptions) {
      this.selectRow(focusedOption);
      } else if (!this.state.shouldDisableRowSelection) {
      this.setState({shouldDisableRowSelection: true});
      let result = this.selectRow(focusedOption);
      if (!(result instanceof Promise)) {
      result = Promise.resolve();
      }
      setTimeout(() => {
      result.finally(() => {
      this.setState({shouldDisableRowSelection: false});
      });
      }, 500);
      }
      }

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

    1. Passing additional prop named keyForList to OptionRow. It will become to:
                <OptionRow
                    keyForList={item.keyForList}
    
    1. Then, pass the above keyForList props to PressableWithFeedback
      It will become to:
                        <PressableWithFeedback
                            testID={props.keyForList}
    
    1. Finally, update the logic to get the focusedOption in here:
      const focusedOption = this.state.allOptions[this.state.focusedIndex];

      It will become to:
    const focusedItemKey = lodashGet(e, ['target', 'attributes', 'data-testid', 'value']);
            const focusedOption = focusedItemKey ? _.find(this.state.allOptions, (option) => option.keyForList === focusedItemKey) : this.state.allOptions[this.state.focusedIndex];
    

    What alternative solutions did you explore? (Optional)

    • NA
  10. alexpensify commented on Dec 4, 2023

    @alexpensify
    Contributor

    @alitoshmatov please keep us posted if any of the proposals will fix this issue. Thanks!

  11. 42 remaining items

  12. alexpensify commented on Jan 3, 2024

    @alexpensify
    Contributor

    @alitoshmatov or @deetergp - can you please help confirm if this PR did cause regression? Thanks!

  13. alitoshmatov commented on Jan 4, 2024

    @alitoshmatov
    Contributor

    Based on my observation, our PR didn't directly cause this regression, the regression didn't occur after merging our PR. However our solution was based on faulty approach which was already implemented by #32252. We took this solution for granted and followed the same approach. Finally #33491 PR caused the regression which broke our faulty solution. I am okay if penalty is applied to my payment, since I should have been more cautious on my review.

    cc: @alexpensify, @deetergp, @Beamanator (since you worked on fixing the regression)

  14. alexpensify commented on Jan 5, 2024

    @alexpensify
    Contributor

    Thank you @alitoshmatov for this update. @Beamanator and @deetergp can I get some feedback here regarding this payment? Thanks!

  15. melvin-bot commented on Jan 8, 2024

    @melvin-bot

    @deetergp, @alexpensify, @alitoshmatov, @DylanDylann Whoops! This issue is 2 days overdue. Let's get this updated quick!

  16. alexpensify commented on Jan 8, 2024

    @alexpensify
    Contributor

    Bumping - @deetergp and @Beamanator can I get your feedback here?

  17. Beamanator commented on Jan 10, 2024

    @Beamanator
    Contributor

    I agree with @alitoshmatov 's summary here: #32388 (comment)

    1. The PR for this issue (Fix: focusing on item by tab key does not work #33265) was merged 3 weeks ago
    2. The PR which technically caused the regression was [NoQA] add perf tests to OptionsSelector #33491, which was merged 2 weeks ago

    While the PR for this issue and this one were a bit iffy & weren't perfect, they didn't cause the regressions so I don't believe payment here should have the penalty applied

  18. alexpensify commented on Jan 11, 2024

    @alexpensify
    Contributor

    Thanks, I'll work on the payment process tomorrow.

  19. alexpensify commented on Jan 11, 2024

    @alexpensify
    Contributor

    Closing - I updated the summary here: #32388 (comment)

    Everyone has been paid via Upwork and I closed that job.

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions