Skip to content

[$500] Profile - Contact method - App does not refocus to magic code on canceling contact method remove #28590

Closed

Description

@izarutskaya

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 settings->profile->contact method
  3. Open pending contact method or add new contact method and open it
  4. Click on remove and in popup, click on cancel
  5. Observe that app does not refocus on magic code input

Expected Result:

App should refocus on magic code input when we cancel remove as we do for composer when we cancel deleting any message

Actual Result:

App does not refocus to magic code on canceling contact method remove

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • Windows / Chrome
  • MacOS / Desktop

Version Number: v1.3.75-8

Reproducible in staging?: Y

Reproducible in production?: N

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

windows.chrome.no.refocus.on.magic.code.after.cancel.remove.mp4
android.chrome.app.does.not.refocus.to.magic.code.on.remove.cancel.mp4
android.native.app.does.not.refocus.to.magic.code.on.remove.cancel.mov
ios.safari.native.app.does.not.refocus.to.magic.code.on.remove.cancel.mov
mac.chrome.desktop.app.does.not.refocus.to.magic.code.on.remove.cancel.mov
Recording.1678.mp4

Expensify/Expensify Issue URL:

Issue reported by: @dhanashree-sawant

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1696096988753079

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01acef7fd06fbd423e
  • Upwork Job ID: 1708775391646695424
  • Last Price Increase: 2023-10-02

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    ExternalAdded to denote the issue can be worked on by a contributor
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 2, 2023
  2. changed the title [-]Profile - Contact method - App does not refocus to magic code on canceling contact method remove[/-] [+][$500] Profile - Contact method - App does not refocus to magic code on canceling contact method remove[/+] on Oct 2, 2023
  3. melvin-bot commented on Oct 2, 2023

    @melvin-bot

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

  4. melvin-bot commented on Oct 2, 2023

    @melvin-bot
  5. melvin-bot commented on Oct 2, 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
  6. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Oct 2, 2023
  7. melvin-bot commented on Oct 2, 2023

    @melvin-bot

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

  8. izarutskaya commented on Oct 2, 2023

    @izarutskaya
    Author

    Not reproduced on Production

    Recording.1679.mp4
  9. saranshbalyan-1234 commented on Oct 2, 2023

    @saranshbalyan-1234
    Contributor

    Proposal

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

    App does not refocus to magic code on canceling contact method remove

    What is the root cause of that problem?

    Focus method is not called here

    toggleDeleteModal(isOpen) {
    this.setState({isDeleteModalOpen: isOpen});
    Keyboard.dismiss();
    }

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

    Need go call focus method with setTimeout

        toggleDeleteModal(isOpen) {
            this.setState({isDeleteModalOpen: isOpen});
            Keyboard.dismiss();
            setTimeout(() => this.validateCodeFormRef.current.focus(), 400);
        }

    Setimeout is required as page is currently re-rendering while modal is being closed.

    What alternative solutions did you explore? (Optional)

    N/A

  10. dukenv0307 commented on Oct 2, 2023

    @dukenv0307
    Contributor

    Proposal

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

    Profile - Contact method - App does not refocus to magic code on canceling contact method remove

    What is the root cause of that problem?

    We don't have the logic to refocus the input when the confirm modal is closed

    <ConfirmModal
    title={this.props.translate('contacts.removeContactMethod')}
    onConfirm={this.confirmDeleteAndHideModal}
    onCancel={() => this.toggleDeleteModal(false)}
    prompt={this.props.translate('contacts.removeAreYouSure')}
    confirmText={this.props.translate('common.yesContinue')}
    cancelText={this.props.translate('common.cancel')}
    isVisible={this.state.isDeleteModalOpen && !isDefaultContactMethod}

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

    We should add onModalHide prop for ConfirmModal that will be triggered after the modal is closed to refocus the input

    onModalHide={() => InteractionManager.runAfterInteractions(() => {
        this.validateCodeFormRef.current.focus();
    })}
    

    <ConfirmModal
    title={this.props.translate('contacts.removeContactMethod')}
    onConfirm={this.confirmDeleteAndHideModal}
    onCancel={() => this.toggleDeleteModal(false)}
    prompt={this.props.translate('contacts.removeAreYouSure')}
    confirmText={this.props.translate('common.yesContinue')}
    cancelText={this.props.translate('common.cancel')}
    isVisible={this.state.isDeleteModalOpen && !isDefaultContactMethod}

    What alternative solutions did you explore? (Optional)

    NA

    Result

    Screencast.from.02-10-2023.16.47.48.webm
  11. 9 remaining items

  12. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on Oct 2, 2023
  13. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Oct 2, 2023
  14. mountiny commented on Oct 2, 2023

    @mountiny
    Contributor

    The PR was reverted and this is not a blcoker anymore https://expensify.slack.com/archives/C9YU7BX5M/p1696260504107759?thread_ts=1696257638.565279&cid=C9YU7BX5M

    I believe the only pending thing here @peterdbarkerUK is to pay $50 to @dhanashree-sawant for reporting this blocker

  15. added
    ReviewingHas a PR in review
    and removed on Oct 3, 2023
  16. peterdbarkerUK commented on Oct 6, 2023

    @peterdbarkerUK
    Contributor
  17. dhanashree-sawant commented on Oct 6, 2023

    @dhanashree-sawant

    Thanks @peterdbarkerUK, I have accepted the offer.

  18. peterdbarkerUK commented on Oct 6, 2023

    @peterdbarkerUK
    Contributor

    Sweet

    Reporter: $50 paid to @dhanashree-sawant

    Thanks for your continued prolific work @dhanashree-sawant!

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.EngineeringExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions