Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD for payment 2023-10-30] [$500] Log in - Keyboard is not consistent in safari and pressing enter does not submit a form #28569

Closed
1 of 6 tasks
lanitochka17 opened this issue Oct 1, 2023 · 40 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Oct 1, 2023

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. Go to sign in page
  2. Enter any email
  3. Notice that keyboard in native ios app and safari web is not the same

Expected Result:

Both keyboard should be the same, or at least pressing "Go" should submit a form

Actual Result:

Keyboards are not consistent.
a) In safari instead of "Return" sign it says "Go"
b) And pressing it won't submit the form unlike the native app

Workaround:

Unknown

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.75-8

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):

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

Safari

Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-09-30.at.14.36.21.mp4

IOS app

Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-09-30.at.19.14.41.mp4
0-02-01-e5f3ab9fd9fe8e1dc8753548fa3c0dff6684080e6559b01a5fe4cb4038681009_4347d5f6cdd36b14.mp4

Expensify/Expensify Issue URL:

Issue reported by: @alitoshmatov

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1696083514018509

n+is%3Aissue+label%3A%22Help+Wanted%22)

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01d106743c23a6474e
  • Upwork Job ID: 1708590752340430848
  • Last Price Increase: 2023-10-15
  • Automatic offers:
    • Ollyws | Reviewer | 27213706
    • ZhenjaHorbach | Contributor | 27213707
    • alitoshmatov | Reporter | 27213710
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 1, 2023
@melvin-bot melvin-bot bot changed the title Log in - Keyboard is not consistent in safari and pressing enter does not submit a form [$500] Log in - Keyboard is not consistent in safari and pressing enter does not submit a form Oct 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 1, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01d106743c23a6474e

@melvin-bot
Copy link

melvin-bot bot commented Oct 1, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 1, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Oct 1, 2023

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

@ZhenjaHorbach
Copy link
Contributor

ZhenjaHorbach commented Oct 1, 2023

Proposal

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

Confirm buttons have different names

and pressing enter does not submit a form on safari web (Not reproduce on emulator and live device)

What is the root cause of that problem?

We don't pass returnKeyType value for choosing submit button name

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

we can pass returnKeyType="done" or other available name for this component

<TextInput
ref={input}
label={translate('loginForm.phoneOrEmail')}
accessibilityLabel={translate('loginForm.phoneOrEmail')}
accessibilityRole={CONST.ACCESSIBILITY_ROLE.TEXT}
value={login}
autoCompleteType="username"
textContentType="username"
nativeID="username"
name="username"
onChangeText={onTextInput}
onSubmitEditing={validateAndSubmitForm}
autoCapitalize="none"
autoCorrect={false}
keyboardType={CONST.KEYBOARD_TYPE.EMAIL_ADDRESS}
errorText={formErrorText}
hasError={hasError}
maxLength={CONST.LOGIN_CHARACTER_LIMIT}
/>

What alternative solutions did you explore? (Optional)

NA

@neonbhai
Copy link
Contributor

neonbhai commented Oct 2, 2023

Proposal

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

The enter key text is not consistent across platforms.

What is the root cause of that problem?

We don't explicitly set the text for enter key in virtual keyboards. So the keyboards tries to gauge the context on its own, resulting in inconsistent behaviour.

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

We should set the enterKeyHint prop for the TextInput here:

<TextInput
ref={input}
label={translate('loginForm.phoneOrEmail')}
accessibilityLabel={translate('loginForm.phoneOrEmail')}

This prop controls the value of text on enter key.

The possible values are:

  • enter
  • done
  • next
  • search
  • send

Reference

I will suggest adding next.

  • enterKeyHint always has precedence over returnKeyType.
  • returnKeyType has ios-styling options, which could term it as ios focused prop, whereas,
  • enterKeyHint is a global HTML attribute. Ref

What alternative solutions did you explore? (Optional)

xx

@tienifr
Copy link
Contributor

tienifr commented Oct 2, 2023

Proposal

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

Keyboards are not consistent.

  1. Pressing it won't submit the form unlike the native app
  2. In safari instead of "Return" sign it says "Go"

What is the root cause of that problem?

  1. In here, we're not executing the keyboard listener callback (early return), but it still triggers the preventDefault here. When preventDefault is triggered, the onSubmitEditing is not triggered, causing the form to not submit.
  2. We're not specifying the returnKeyType/enterKeyHint in the TextInput here, so the browser will infer the value, which is different from native.

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

  1. We need to make sure the preventDefault is not executed if the callback is not executed.

This can be done by a few ways:
a. [Recommended] The callback will now return a boolean indicating if it's executed or not. For example return false here (and return true at the last)
In here, we only call preventDefault if the callback is executed

let isExecuted = false;

if (_.isFunction(callback.callback)) {
    isExecuted = callback.callback(event) !== false;
}
if (isExecuted && callback.shouldPreventDefault) {
    event.preventDefault();
}

b. Or we can pass shouldPreventDefault false when we register that listener
c. Or to make sure the component is not rendered prematurely on login screen, so no listener is registered, however this might still impact other inputs once that component is rendered after we login.

  1. We can just add returnKeyType (better because it's cross platform) or enterKeyHint to the TextInput, I think next is appropriate

What alternative solutions did you explore? (Optional)

Other inputs might have the same issue, we might want to double check and fix similar to above.

Currently all onSubmitEditing in the app does not work due to the above issues, but the issue doesn't show up because the submission is also handled by the Form button. So an alternative is we can remove all usage of onSubmitEditing as a cleanup.

@ayazalavi
Copy link
Contributor

Proposal

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

Enter key press not submitting form in iOS Safari

What is the root cause of that problem?

Root cause of the problem is simply there is onKeyPress handler in

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

Adding following code in above file will ensure key press will be handled on pressing enter key.
onKeyPress={({nativeEvent}) => nativeEvent.code === "Enter" && validateAndSubmitForm()}

enterKeyHint/returnKeyType will simply set text label of return button, it will not submit form unless we have keypress handler attached to the textinput over which soft keyboard is being shown.

It should work on all platforms but it still needs to be cross verified if C+ picks this proposal.

Result

Untitled.13.mp4

What alternative solutions did you explore? (Optional)

N/A

@flaviadefaria
Copy link
Contributor

@Ollyws any thoughts on the proposals above?

@Ollyws
Copy link
Contributor

Ollyws commented Oct 3, 2023

I can no longer reproduce the enter key issue, I think it may have been fixed by #28374 can anyone else confirm?

@ayazalavi
Copy link
Contributor

@Ollyws yes it is fixed.

@Ollyws
Copy link
Contributor

Ollyws commented Oct 4, 2023

In that case all that's left is the enter key label and @ZhenjaHorbach's proposal looks good for that.
🎀👀🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2023

Triggered auto assignment to @MonilBhavsar, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@alitoshmatov
Copy link
Contributor

@Ollyws One note that this is not just signin page, this issue come up on #28409 which also has one input and submit was not working. I assume this happens in other places too

@ayazalavi
Copy link
Contributor

@alitoshmatov @Ollyws I think this can be fixed in all places if we implement onKeyPress handler in TextInput component and pass it a prop submitOnEnter which should handle submitting form. Can be generic solution.

@tienifr
Copy link
Contributor

tienifr commented Oct 4, 2023

@Ollyws Hi can you give some feedback on my proposal here?

I can no longer reproduce the enter key issue, I think it may have been fixed by #28374 can anyone else confirm?

This is indeed no longer reproducible due to that PR but that's a workaround that only accidentally fixes the issue. The root cause is still there and all usage of onSubmitEditing in the app currently basically does not work (you can validate by put a log into those onSubmitEditing callback). So I think we should still fix that.

cc @MonilBhavsar

@MonilBhavsar
Copy link
Contributor

I agree we should resolve the root cause and for all the forms.
@Ollyws could you please take a look at the above comment.

@melvin-bot
Copy link

melvin-bot bot commented Oct 8, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Oct 8, 2023
@Ollyws
Copy link
Contributor

Ollyws commented Oct 8, 2023

@tienifr

you can validate by put a log into those onSubmitEditing callback

I tried this and onSubmitEditing works fine when pressing enter in both BaseLoginForm.js and BaseValidateCodeForm.js:

Video
callbacks_example.mp4

It also seems to work fine in OptionsSelector, PDFPasswordForm, The bank account forms. I couldn't seem to find an instance where it didn't work.

Am I missing something?

@Ollyws
Copy link
Contributor

Ollyws commented Oct 12, 2023

@MonilBhavsar We're good to proceed with #28569 (comment). Thanks!

@melvin-bot
Copy link

melvin-bot bot commented Oct 15, 2023

@Ollyws @stephanieelliott @MonilBhavsar this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

@melvin-bot melvin-bot bot added the Overdue label Oct 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 15, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@MonilBhavsar
Copy link
Contributor

Thanks for clarifying! 🙌

@melvin-bot melvin-bot bot removed the Overdue label Oct 16, 2023
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

📣 @Ollyws 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

📣 @ZhenjaHorbach 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot
Copy link

melvin-bot bot commented Oct 16, 2023

📣 @alitoshmatov 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@ZhenjaHorbach
Copy link
Contributor

Offer link

PR will be ready today

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Oct 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 20, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @ZhenjaHorbach got assigned: 2023-10-16 05:41:50 Z
  • when the PR got merged: 2023-10-20 09:48:34 UTC
  • days elapsed: 4

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 23, 2023
@melvin-bot melvin-bot bot changed the title [$500] Log in - Keyboard is not consistent in safari and pressing enter does not submit a form [HOLD for payment 2023-10-30] [$500] Log in - Keyboard is not consistent in safari and pressing enter does not submit a form Oct 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.88-11 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-10-30. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Oct 23, 2023

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:

  • [@Ollyws] The PR that introduced the bug has been identified. Link to the PR:
  • [@Ollyws] 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:
  • [@Ollyws] A discussion in #expensify-bugs 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:
  • [@Ollyws] Determine if we should create a regression test for this bug.
  • [@Ollyws] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@stephanieelliott] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 29, 2023
@Ollyws
Copy link
Contributor

Ollyws commented Oct 30, 2023

  • The PR that introduced the bug has been identified. Link to the PR:

We can't really say this was a regression from any PR, we just never added the returnKeyType to the login form.

  • 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:

N/A

  • A discussion in #expensify-bugs 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:

N/A

  • Determine if we should create a regression test for this bug.

I don't think a regression test would be helpful here as it's a very minor visual inconsistency that doesn't affect the flow in any meaningful way.

@stephanieelliott
Copy link
Contributor

Summarizing payment on this issue:

Upwork job is here, no bonus is included on payout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

10 participants