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.36k stars 2.79k forks source link

[WAITING ON RE-TEST] Web - Inconsistency bug: Paypal triggers save on shift+enter #23655

Closed kbecciv closed 1 year ago

kbecciv 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!


Action Performed:

  1. Open the app
  2. Open settings
  3. Open payment
  4. If already added, then click on edit paypal.me account or click on add payment method and select paypal.me
  5. Type anything and click shift+enter

Expected Result:

App should not trigger save on shift enter for paypal.me as it does not for similar type of single line description field in request money/ split bill

Actual Result:

App trigger save on shift enter for paypal.me

Workaround:

Unknown

Platforms:

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

Version Number: 1.3.44-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 Notes/Photos/Videos: Any additional supporting documentation

https://github.com/Expensify/App/assets/93399543/4593cc57-a942-43ed-9e47-557a86c42fe2

https://github.com/Expensify/App/assets/93399543/8db8d931-4045-4f9c-9460-df1a03e30625

Expensify/Expensify Issue URL: Issue reported by: @dhanashree-sawant Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690171163554959

View all open jobs on GitHub

melvin-bot[bot] commented 1 year ago

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

melvin-bot[bot] commented 1 year ago

Bug0 Triage Checklist (Main S/O)

huzaifa-99 commented 1 year ago

Proposal

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

We want the AddPayPalMePage inputs to work the same as other inputs

What is the root cause of that problem?

In AddPayPalMePage we are using Button instead of the custom Form, and in Button we trigger onPress prop when enter key is pressed, but we don't check for modifier keys (ctrl/cmd/shift etc) here. So enter with any modifier key combination works.

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

We can do these things

  1. Update button enter key listener, and return early if any modifier key was pressed (this can be done via prop)

    if (e.shiftKey || e.ctrlKey || e.altKey || e.metaKey) return
  2. Migrate the AddPayPalMePage to use the custom form component. Along with minor things, we would need to add a new onyx key, update the code to match the existing UI, and optionally add validation errors.

What alternative solutions did you explore? (Optional)

N/A

jliexpensify commented 1 year ago

Is this still an issue? I just tested on Chrome on v1.3.46-0 and SHIFT+Enter does nothing for me.

@kbecciv can you retest and share a new video?

kbecciv commented 1 year ago

Unable to reproduce it on build 1.3.46-0

https://github.com/Expensify/App/assets/93399543/753ac3d1-5b14-4be7-89c3-3ac7796e162a

jliexpensify commented 1 year ago

Nice one, thanks @kbecciv!