Skip to content

[HOLD for payment 2023-07-05] [$2000] iOS - Keyboard does not hide when switching between attachments with focused password input field #19156

Closed

Description

@mvtglobally

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. Login with any account
  3. Send several attachments including PDF-protected file
  4. Click to preview on PDF-protected file -> Press Enter a password
  5. Switching to another attachment

Expected Result:

Keyboard should be hidden

Actual Result:

Keyboard does not hide

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: v1.3.15-6
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

Bug6059021_VID20230517234805__1_.mp4

Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014d32d06c969c5ab1
  • Upwork Job ID: 1661854565030178816
  • Last Price Increase: 2023-06-21

Activity

  1. added
    Daily
    Bug
    on May 17, 2023
  2. melvin-bot commented on May 17, 2023

    @melvin-bot

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

  3. melvin-bot commented on May 17, 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
  4. ahmedGaber93 commented on May 17, 2023

    @ahmedGaber93
    Contributor

    Proposal

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

    Keyboard does not hide when switching between attachments with focused password input field.

    What is the root cause of that problem?

    There is no Keyboard.dismiss(); when next/prev button press

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

    1. When the user navigates away from the PDF password form by clicking on the arrow buttons, dismiss the keyboard.
      call Keyboard.dismiss(); in next/prev button onPress here and here

    2. When the user clicks on the eye icon while the keyboard is open, it should toggle immediately without dismissing keyboard.
      Add keyboardShouldPersistTaps="handled" to AttachmentCarousel Flatlist here.

    3. When the user navigates away from the PDF password form to other attachments by swiping, dismiss the keyboard
      Add keyboardDismissMode="on-drag" to AttachmentCarousel Flatlist here.

    4. When the user navigates back to the PDF password form, focus the input and bring up the keyboard again
      pass isPageActive to AttchmentView here then here then here

    // in AttchmentView
    isPageActive={this.state.attachments[this.state.page].source === item.source}
    // in PDFPasswordForm
      componentDidUpdate(prevProps) {
          if (!prevProps.isPageActive && this.props.isPageActive && this.textInputRef) {
              this.textInputRef.focus();
          }
      }
        
     <TextInput ref={(el) => (this.textInputRef = el)}  /> 
    1. fix auto-focus doesn't work when swipe between protected PDFs quickly

    This because when you swipe quickly, swipe not complete to view the whole PDF.
    We can fix it by reduce itemVisiblePercentThreshold: 95 to 75

    this.viewabilityConfig = {
    // To facilitate paging through the attachments, we want to consider an item "viewable" when it is
    // more than 90% visible. When that happens we update the page index in the state.
    itemVisiblePercentThreshold: 95,
    };

    1. fix auto-focus not work in safari (this issue happened with me last week, but now it is not reproducible).
      If this issue appears again, the fix should be.
      surround this.textInputRef.focus(); with timeout 300 if browser is mobile safari
      // in PDFPasswordForm
      import * as Browser from '../../libs/Browser';
    
      componentDidUpdate(prevProps) {
          if (!prevProps.isPageActive && this.props.isPageActive && this.textInputRef) {
              const isMobileSafari = Browser.isMobileSafari();
              if(isMobileSafari){
                  setTimeout(() => this.textInputRef.focus(), 300)
              }else{
                  this.textInputRef.focus();
              }
          }
      }

    What alternative solutions did you explore? (Optional)

  5. sonialiap commented on May 23, 2023

    @sonialiap
    Contributor

    I'm unable to reproduce on the browserstack emulator on iPhone 13 v16.3.

    The arrow buttons are inconsistent. I was not able to figure out how to get them to show up if they weren't showing up. Swiping between attachments closes the keyboard.

    Enjoy my struggle 😂

    Screen.Recording.2023-05-23.at.3.25.39.PM.mov
  6. sonialiap commented on May 23, 2023

    @sonialiap
    Contributor

    @ahmedGaber93 since you proposed a solution, are you able to reproduce this issue?

  7. ahmedGaber93 commented on May 23, 2023

    @ahmedGaber93
    Contributor

    @sonialiap yes, I am able to reproduce.

    Screen.Recording.2023-05-23.at.7.30.31.PM.mov
  8. sonialiap commented on May 25, 2023

    @sonialiap
    Contributor

    Thanks! Adding the external label

  9. added
    External
    on May 25, 2023
  10. 94 remaining items

  11. dukenv0307 commented on Jun 23, 2023

    @dukenv0307
    Contributor

    @aimane-chnaif #21367 The PR is ready for review

  12. melvin-bot commented on Jun 26, 2023

    @melvin-bot

    🎯 ⚡️ Woah @aimane-chnaif / @dukenv0307, great job pushing this forwards! ⚡️

    The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

    • when @dukenv0307 got assigned: 2023-06-22 16:24:21 Z
    • when the PR got merged: 2023-06-26 15:24:04 UTC

    On to the next one 🚀

  13. added
    Weekly
    Awaiting Payment
    and removed
    Daily
    on Jun 28, 2023
  14. changed the title [-][$2000] iOS - Keyboard does not hide when switching between attachments with focused password input field[/-] [+][HOLD for payment 2023-07-05] [$2000] iOS - Keyboard does not hide when switching between attachments with focused password input field[/+] on Jun 28, 2023
  15. removed
    Reviewing
    on Jun 28, 2023
  16. melvin-bot commented on Jun 28, 2023

    @melvin-bot

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

  17. melvin-bot commented on Jun 28, 2023

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.33-4 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-07-05. 🎊

    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

    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
  18. melvin-bot commented on Jun 28, 2023

    @melvin-bot

    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:

    • [@aimane-chnaif] The PR that introduced the bug has been identified. Link to the PR:
    • [@aimane-chnaif] 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:
    • [@aimane-chnaif] 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:
    • [@aimane-chnaif] Determine if we should create a regression test for this bug.
    • [@aimane-chnaif] 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.
    • [@sonialiap] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
  19. added
    Daily
    and removed
    Weekly
    on Jul 4, 2023
  20. aimane-chnaif commented on Jul 5, 2023

    @aimane-chnaif
    Contributor

    No PRs caused regression. These were missing cases while implementing new feature of attachment carousel.

    Regression Test Step:

    1. Go to any chat room
    2. Send multiple attachments including protected PDF
    3. Click preview on protected PDF -> Press Enter a password
    4. Click 👁️ while keyboard is open
    5. Verify that it toggles immediately without dismissing keyboard
    6. Navigates away from the PDF password form by clicking on the arrow buttons or by swiping
    7. Verify that keyboard is dismissed automatically
    8. Navigate back to the PDF password form
    9. Verify that password input is focused automatically and bring up the keyboard again
  21. sonialiap commented on Jul 5, 2023

    @sonialiap
    Contributor

    @dukenv0307 offer sent for fix (+bonus) - paid ✔️
    @aimane-chnaif offer sent for review (+bonus) - paid ✔️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions