You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2023-10-30] [$500] Log in - Keyboard is not consistent in safari and pressing enter does not submit a form #28569
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[/+]on Oct 1, 2023
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:
Please re-state the problem that we are trying to solve in this issue.
Keyboards are not consistent.
Pressing it won't submit the form unlike the native app
In safari instead of "Return" sign it says "Go"
What is the root cause of that problem?
In here, we're not executing the keyboard listener callback (early return), but it still triggers the preventDefaulthere. When preventDefault is triggered, the onSubmitEditing is not triggered, causing the form to not submit.
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?
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 falsehere (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.
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.
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)
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[/+]on 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:
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:
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.
Activity
[-]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[/+]melvin-bot commentedon Oct 1, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01d106743c23a6474e
melvin-bot commentedon Oct 1, 2023
Triggered auto assignment to @flaviadefaria (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Oct 1, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Oct 1, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Ollyws (
External)ZhenjaHorbach commentedon 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 componentApp/src/pages/signin/LoginForm/BaseLoginForm.js
Lines 200 to 218 in 00933e1
What alternative solutions did you explore? (Optional)
NA
neonbhai commentedon 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
enterKeyHintprop for theTextInputhere:App/src/pages/signin/LoginForm/BaseLoginForm.js
Lines 200 to 203 in b403ab5
This prop controls the value of text on enter key.
The possible values are:
Reference
I will suggest adding
next.What alternative solutions did you explore? (Optional)
xx
tienifr commentedon Oct 2, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Keyboards are not consistent.
What is the root cause of that problem?
preventDefaulthere. WhenpreventDefaultis triggered, the onSubmitEditing is not triggered, causing the form to not submit.returnKeyType/enterKeyHintin 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?
preventDefaultis 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 falsehere (and return true at the last)In here, we only call
preventDefaultif the callback is executedb. Or we can pass
shouldPreventDefaultfalse when we register that listenerc. 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.
returnKeyType(better because it's cross platform) orenterKeyHintto the TextInput, I thinknextis appropriateWhat 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
onSubmitEditingin 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 ofonSubmitEditingas a cleanup.ayazalavi commentedon Oct 2, 2023
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
App/src/pages/signin/LoginForm/BaseLoginForm.js
Line 200 in 2160bab
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
40 remaining items
melvin-bot commentedon 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:
On to the next one 🚀
[-][$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[/+]melvin-bot commentedon Oct 23, 2023
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon 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.
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:
melvin-bot commentedon 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 commentedon Oct 30, 2023
We can't really say this was a regression from any PR, we just never added the returnKeyType to the login form.
N/A
N/A
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 commentedon Oct 30, 2023
Summarizing payment on this issue:
Upwork job is here, no bonus is included on payout