Skip to content

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

Closed

Description

@kbecciv

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

Activity

  1. added
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 12, 2023
  2. namhihi237 commented on Sep 12, 2023

    @namhihi237
    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

  3. 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[/+] on Sep 12, 2023
  4. melvin-bot commented on Sep 12, 2023

    @melvin-bot
  5. melvin-bot commented on Sep 12, 2023

    @melvin-bot

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

  6. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Sep 12, 2023
  7. melvin-bot commented on Sep 12, 2023

    @melvin-bot

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

    @melvin-bot

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

  9. melvin-bot commented on Sep 12, 2023

    @melvin-bot

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

  10. ishpaul777 commented on Sep 12, 2023

    @ishpaul777
    Contributor

    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]);
  11. hoangzinh commented on Sep 13, 2023

    @hoangzinh
    Contributor

    It seems expected behavior since this change #26025

  12. studentofcoding commented on Sep 13, 2023

    @studentofcoding
    Contributor

    It seems expected behavior since this change #26025

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

  13. dhanashree-sawant commented on Sep 13, 2023

    @dhanashree-sawant

    It is inconsistent with other fields throughout the app

  14. garrettmknight commented on Sep 14, 2023

    @garrettmknight
    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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributors

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions