Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.56k stars 2.9k forks source link

[$500] Clicking "Enter" key selects and unselects the user in group split bill #30649

Closed m-natarajan closed 1 year ago

m-natarajan commented 1 year ago

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.3.93.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: @dhanashree-sawant Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1696935067155479

Action Performed:

  1. Open the app
  2. Open any group chat
  3. Click on plus and click on split bill
  4. Enter any amount and continue
  5. Unselect few users from below
  6. Click "enter" key and observe that app select unselects the user

    Expected Result:

    App should select the user and move on to next user on "enter" key click

    Actual Result:

    App select unselects same user every time on enter click on group split bill

Workaround:

unknown

Platforms:

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

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari https://github.com/Expensify/App/assets/38435837/e3b87934-9d54-495b-bb7d-e5a7511425b0 https://github.com/Expensify/App/assets/38435837/3680cb36-e9e3-4eba-a64d-8def1fbbe2b6 https://github.com/Expensify/App/assets/38435837/ec113508-a4b4-4eaf-90f9-0a017a6d8731 https://github.com/Expensify/App/assets/38435837/7bec80c9-4d7e-47c1-831d-56b665997062
MacOS: Desktop https://github.com/Expensify/App/assets/38435837/b523fc53-0f79-45a1-8845-541873f3f1dd

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010303eb8cba36ffc8
  • Upwork Job ID: 1719416022134972416
  • Last Price Increase: 2023-10-31
melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

Job added to Upwork: https://www.upwork.com/jobs/~010303eb8cba36ffc8

melvin-bot[bot] commented 1 year ago

Bug0 Triage Checklist (Main S/O)

melvin-bot[bot] commented 1 year ago

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

esh-g commented 1 year ago

Proposal

Please re-state the problem we are trying to solve

Clicking "Enter" key selects and unselects the user in group split bill

What is the root cause of this problem?

The OptionSelector has a different focus system than the inbuilt browser one. This is caused due to the conflict between the two.

What changes should be made to fix this?

We should prevent the default browser focus by passing the prop shouldPreventDefaultFocusOnSelectRow as !Browser.isMobile() in MoneyRequestConfirmationList.js here: https://github.com/Expensify/App/blob/594551004f6d8e06beea6fc6dbd9f6a2166ab751/src/components/MoneyRequestConfirmationList.js#L554-L560

just like we do in other places like: https://github.com/Expensify/App/blob/594551004f6d8e06beea6fc6dbd9f6a2166ab751/src/pages/RoomInvitePage.js#L227 https://github.com/Expensify/App/blob/594551004f6d8e06beea6fc6dbd9f6a2166ab751/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSelector.js#L292 https://github.com/Expensify/App/blob/594551004f6d8e06beea6fc6dbd9f6a2166ab751/src/pages/workspace/WorkspaceInvitePage.js#L276

What alternative options did you explore?

Wherever we use the shouldPreventDefaultFocusOnSelectRow, we are using the !Browser.isMobile() as the value passed to it... So, I think we can refactor the code to have the default value of this prop set to !Browser.isMobile() in the list items itself in components like BaseListItem.js and OptionRow.js.

akamefi202 commented 1 year ago

Dupe with https://github.com/Expensify/App/issues/21392

s77rt commented 1 year ago

@lschurr Let's close this as a dupe ^

jaimishpatel5 commented 1 year ago

Proposal

Please re-state the problem that we are trying to solve in this issue. Clicking "Enter" key selects and unselects the user in group split bill

What is the root cause of that problem? We were passing shouldPreventDefaultFocusOnSelectRow always false

What changes do you think we should make in order to solve the problem? in default props for OptionsSelector.js we should update shouldPreventDefaultFocusOnSelectRow to true. const defaultProps = { onSelectRow: undefined, textInputLabel: '', placeholderText: '', keyboardType: 'default', selectedOptions: [], headerMessage: '', canSelectMultipleOptions: false, shouldShowMultipleOptionSelectorAsButton: false, multipleOptionSelectorButtonText: '', onAddToSelection: () => { }, highlightSelectedOptions: false, hideSectionHeaders: false, boldStyle: false, showTitleTooltip: false, //here// shouldPreventDefaultFocusOnSelectRow: true }

What alternative solutions did you explore? (Optional) none

https://github.com/Expensify/App/assets/20947611/38960fa1-41fb-4b1c-9e4d-07de034986d1

lschurr commented 1 year ago

Closing as a dupe.