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

[$500] Web - Password protected PDF password field stays in focus even on error #27281

Closed
1 of 6 tasks
kbecciv opened this issue Sep 12, 2023 · 11 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@kbecciv
Copy link

kbecciv commented Sep 12, 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. Open the app
  2. Open any report
  3. Send password protected PDF
  4. Open the PDF and click on 'enter the password'
  5. Press enter to submit and observe that even though error was triggered, field still has focus

Expected Result:

App should lose focus from the password field after error as we do for all the fields throughout the app

Actual Result:

App keeps the focus on the password field after error in password protected PDF preview

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.68.12
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

focus.retained.password.protected.PDF.error.mp4
Recording.4420.mp4

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014ece584d36e5bf8f
  • Upwork Job ID: 1701667882556108800
  • Last Price Increase: 2023-09-12
@kbecciv kbecciv 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 Sep 12, 2023
@namhihi237
Copy link
Contributor

Proposal

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

App keeps the focus on the password field after an error in password protected PDF preview

What is the root cause of that problem?

Input gets focused when we enter the page.
When the user presses the submit button, we don't have the logic to update it to un-focus.

const submitPassword = () => {
if (!validate()) {
return;
}
onSubmit(password);
};

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

We should blur every submission.

    const submitPassword = () => {
        if (textInputRef.current) {
            textInputRef.current.blur();
        }

Result:

Screen.Recording.2023-09-12.at.23.17.59.mov

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot melvin-bot bot changed the title Web - Password protected PDF password field stays in focus even on error [$500] Web - Password protected PDF password field stays in focus even on error Sep 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

Job added to Upwork: https://www.upwork.com/jobs/~014ece584d36e5bf8f

@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

Triggered auto assignment to @garrettmknight (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 Sep 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 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 Sep 12, 2023

Triggered auto assignment to @CortneyOfstad (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 12, 2023

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

@ishpaul777
Copy link
Contributor

ishpaul777 commented Sep 12, 2023

Proposal

Problem

Password protected PDF password field stays in focus even on error

Root cause

We are not removing focus from input when there is a error

changes

Blur textinput if there is a errortext.

 const errorText = useMemo(() => {
        if (isPasswordInvalid) {
            textInputRef.current.blur()
            return translate('attachmentView.passwordIncorrect');
        }
        if (!_.isEmpty(validationErrorText)) {
            textInputRef.current.blur()
            return translate(validationErrorText);
        }
        return '';
    }, [isPasswordInvalid, translate, validationErrorText]);

@hoangzinh
Copy link
Contributor

It seems expected behavior since this change #26025

@studentofcoding
Copy link
Contributor

It seems expected behavior since this change #26025

Yup, agree, I also think it's expected behaviour

@dhanashree-sawant
Copy link

It is inconsistent with other fields throughout the app

@garrettmknight
Copy link
Contributor

This feels pretty consistent in this password case. We're keeping focused on the only thing you can interact with and you'd want to retype your password or leave. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

9 participants