-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 2021-11-04] Sign in - Cursor does not remain in place after wrong password is entered: reported by @kidroca #5191
Comments
Triggered auto assignment to @alex-mechler ( |
Looks like a good external issue. cc @kidroca if you wanted to submit a proposal for this |
Triggered auto assignment to @stephanieelliott ( |
Proposed SolutionWe have to set password input field reference. Thereafter we can set focus to password input field if empty or invalid password. Below code should be added/updated within src/pages/signin/PasswordForm.js
constructor(props) {
super(props);
....
this.passwordInputRef = null; // *** Added this line
this.twoFactorAuthCodeInputRef = null; // *** Added this line
}
// *** Added componentDidUpdate
componentDidUpdate(prevProps) {
if (this.props.account.error !== prevProps.account.error) {
if (this.props.account.error === this.props.translate('passwordForm.error.incorrectLoginOrPassword')) {
this.passwordInputRef.focus();
return;
}
if (this.props.account.error === this.props.translate('passwordForm.error.twoFactorAuthenticationEnabled')) {
this.twoFactorAuthCodeInputRef.focus();
}
}
}
validateAndSubmitForm() {
if (!this.state.password.trim() && this.props.account.requiresTwoFactorAuth && !this.state.twoFactorAuthCode.trim()) {
....
this.passwordInputRef.focus(); // *** Added this line
....
}
if (!this.state.password.trim()) {
....
this.passwordInputRef.focus(); // *** Added this line
....
}
if (this.props.account.requiresTwoFactorAuth && !this.state.twoFactorAuthCode.trim()) {
....
this.twoFactorAuthCodeInputRef.focus(); // *** Added this line
....
}
...
}
<ExpensiTextInput
....
ref={el => this.passwordInputRef = el} // ** added this line
/>
<ExpensiTextInput
...
ref={el => this.twoFactorAuthCodeInputRef = el} // ** added this line
/>
Here is how It works once code updated. (EN) Screen.Recording.2021-09-11.at.11.25.15.AM.movHere is how It works once code updated. (ES) Screen.Recording.2021-09-11.at.11.29.31.AM.movOther Suggestion I can see twoFactorAuthCode related input field also there in this form. It will be used if 2fa requited for the account. But In this issue 2fa input related things not mentioned, So in my proposal focus to 2fa input field related solution not included. If set focus to 2fa input fields also taken care in this issue then kindly inform me, I will consider in this proposal. If 2fa input fields focus needs to taken care via separate issue then I will suggest @isagoico to create another issue for 2fa input focus and kindly mention me as bug suggested by. I will also provide solution if issue assigned to me immediately, I have solution ready for it. Thank you. |
I think we should find out why the field looses focus in the first place, and address that - it might be easier to keep focus from leaving the field instead of programatically triggering focus on different occasions |
Triggered auto assignment to @mountiny ( |
Posted to Upwork: https://www.upwork.com/jobs/~01d33acc9f122f85b8 @mountiny we've got a few proposals already, see above comments! |
Hello, it is Sasha from Upwork. |
Proposal
Working Example: Screen.Recording.2021-09-13.at.11.32.07.PM.mov |
I don't mind having someone else propose and implement a solution IMO what @mananjadhav proposed looks good if it doesn't affect how ios and Android work, e.g. We should not have regressions like the onscreen keyboard staying open after submit. |
Well, it does, but if we don't want this behavior, all we need to do is For example:
|
I tested with blurOnSubmit={false} within Google chrome, Safari. It is not working as expected i.e. Focus not remain in text input after submit. Tested within Expensify version 1.0.97-0 Google chrome (v93.0.4577.82) Screen.Recording.2021-09-14.at.9.48.29.AM.movGoogle chrome (v93.0.4577.82) Incognito Screen.Recording.2021-09-14.at.9.45.35.AM.movSafari v14.1.1. Screen.Recording.2021-09-14.at.9.46.26.AM.mov |
Hello all,
I know it could be resolved by setting an initial state of password input
and resetting it once the password was wrong.
…On Mon, Sep 13, 2021 at 9:30 PM PrashantKumar Mangukiya < ***@***.***> wrote:
I tested with blurOnSubmit={false} within Google chrome, Safari. It is not
working as expected i.e. Focus not remain in text input after submit.
Tested within Expensify version 1.0.97-0
Google chrome (v93.0.4577.82)
https://user-images.githubusercontent.com/7823358/133194730-e4bdb30d-d25a-42f6-b42a-6cc8ba8a7afb.mov
Google chrome (v93.0.4577.82) Incognito
https://user-images.githubusercontent.com/7823358/133194792-7f32abae-187f-457b-96f0-10866a1b3075.mov
Safari v14.1.1.
https://user-images.githubusercontent.com/7823358/133194859-6f375467-3580-4af8-9dbb-05ab6b3b8952.mov
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#5191 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUWEV7BY3YSGS4SFRZV35JDUB3FVTANCNFSM5DZWNCLA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Thank you for your proposals! It would nice to figure out why this is happening at first place (as @kidroca mentioned), so we can dig in a bit more since this is not really a blocker but it is rather nice-to-have. @mananjadhav Could you please double check what @PrashantMangukiya raised about your proposal? Also additionally if you could add screen recording of iOS and Android implementation of your proposal since you wrote you could prevent the keyboard showing up. Thank you! 🙇 If the Feel free to add some new proposals if you can think of anything useful 🚀 |
@mountiny It seems @PrashantMangukiya's findings are correct Here's my updated Proposal:
and then in
and finally, add a reference to the field.
Web Video iOS Video Screen.Recording.2021-09-15.at.1.49.34.AM.mov |
Update: As per @PrashantMangukiya comment below, I have overlooked this solution is not really considering what is happening when focusing the field, but focuses it on every submit. Which is not exactly what we want. |
Hi @mananjadhav, I've placed this issue on hold as per this update, as we are prioritising issues related to a feature release scheduled for 9/24. As an apology for the delay, we will add a $100 bonus as a thank you for waiting. |
Adding |
Thanks @mountiny |
Please refer to this post for updated information on the |
This issue has not been updated in over 15 days. @mananjadhav, @stephanieelliott, @mountiny eroding to Monthly issue. P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do! |
|
N6 hold is lifted, payment for this job will include a $250 bonus. PR is currently undergoing QA |
This was deployed to prod yesterday, starting 7-day regression period. Note to include $250 bonus with job payment. |
Created an issue to investigate/fix why the deploy comment has not been added here. https://github.com/Expensify/Expensify/issues/183206 |
All paid up! |
Hey @stephanieelliott according to the docs I should be getting a bonus for reporting the issue
|
Ah, that info is usually included in the issue title. thanks @kidroca! I created a new job posting in Upwork to pay you out for reporting. Here it is: https://www.upwork.com/jobs/~014c5a6b4de03beeba |
Thank you, I've applied on Upwork. |
All paid up, thanks @kidroca! |
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:
Edit: Please, consider the same steps and expected result for Two factor authentication fields too. These two flows are tightly connected and the solution will be basically same so it does not make much sense to create another issue.
Expected Result:
Cursor should stay in password box so user can correct the mistake without the need to lift the hands off the keyboard.
Actual Result:
Cursor no longer remains in password box, user must manually click into password box to try again.
Workaround:
Manually click into password box
Platform:
Where is this issue occurring?
Version Number: 1.0.96-0
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
New.Expensify.-.Google.Chrome.2021-09-09.19-36-49.mp4
Expensify/Expensify Issue URL:
Issue reported by: @kidroca (Thanks for the video! 🙇♀️)
Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1631205732121400
View all open jobs on GitHub
The text was updated successfully, but these errors were encountered: