Skip to content

Error message appears on the work email screen after tapping other company card feed #86907

Closed

Description

@nlemma

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.3.51-3
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #84889
Email or phone of affected tester (no customers): N/A
Issue reported by: Applause Internal Team
Bug source: Pull Request QA execution
Device used: iPhone 15 iOS 26.3.1
App Component: Other

Action Performed:

  1. Sign in to ND with a public domain email
  2. Create two workspaces, set up company card for both (Regions bank for one, and Mock bank for the other)
  3. Go to the workspace 1 - open Company cards - tap arrow next to the feed name
  4. Tap the feed in the "From other workspaces" section
  5. Verify the "Add your work email" screen is shown

Expected Result:

No errors appear on the "Add your work email screen" after tapping the feed from the other workspace

Actual Result:

Work email field is outlined in red, the error message under the field reads "This field is required". "Please fix the errors in the form before continuing" error is shown above the Save button

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7119172_1775062372512.error.MP4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @narefyev91

Activity

  1. added
    DeployBlockerCash
    Daily
    Bug
    on Apr 1, 2026
  2. melvin-bot commented on Apr 1, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #84889

  3. melvin-bot commented on Apr 1, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  4. github-actions commented on Apr 1, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. MelvinBot commented on Apr 1, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    The WorkspaceCompanyCardAddWorkEmailPage (introduced in PR #84889) uses a FormProvider with a TextInput that has autoFocus. When the page mounts during the RHP navigation transition, the TextInput programmatically receives focus. During or immediately after the transition, the input loses focus (blur), which triggers the FormProvider's onBlur handler at FormProvider.tsx:454-485.

    The onBlur handler:

    1. Marks the email input as "touched" via setTouchedInput(inputID) (line 471)
    2. Runs onValidate(inputValues, !hasServerError) (line 474), which calls the page's validate function
    3. Since the email field is empty (the user hasn't typed anything yet), validate returns {email: 'This field is required'} (line 110-111 of AddWorkEmailPage)
    4. Because the input is now marked as "touched", the error passes through the touchedInputs filter (line 232) and gets set to state
    5. The FormWrapper detects non-empty errors and shows the "Please fix the errors in the form before continuing" banner (line 192)

    This is a cross-platform issue because autoFocus + navigation transitions cause focus/blur cycling on all platforms — the TextInput briefly gains focus from autoFocus and then loses it due to focus management during the screen transition (e.g., FocusTrap, animation, or keyboard avoiding behavior).

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

    In WorkspaceCompanyCardAddWorkEmailPage.tsx, replace the autoFocus prop on the InputWrapper with a manual focus approach that delays focusing until after the navigation transition completes. Use the ScreenWrapper's onEntryTransitionEnd callback to focus the input ref:

    1. Remove autoFocus from the InputWrapper
    2. Add onEntryTransitionEnd to the ScreenWrapper that calls emailInputRef.current?.focus() after the transition

    This is a common pattern used in other form pages in the App (e.g., WorkspaceNamePage, WorkspaceInviteMessagePage) to avoid the focus/blur race condition during navigation transitions.

    What alternative solutions did you explore? (Optional)

    1. Adding shouldValidateOnBlur={false} to FormProvider: This would prevent validation on blur but would also disable legitimate blur-triggered validation after the user interacts with the field.
    2. Clearing form errors with useFocusEffect: Could call clearErrors/clearErrorFields when the screen gains focus, but this would mask the symptom rather than fix the root cause (the premature blur event).
    3. Adding disablePressOnEnter: Would only address the Enter key propagation scenario on web, not the cross-platform autoFocus/blur issue.

    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  6. madmax330 commented on Apr 1, 2026

    @madmax330
    Contributor

    @narefyev91 @linhvovan29546 can you look into this?

  7. added
    Reviewing
    on Apr 2, 2026
  8. m-natarajan commented on Apr 2, 2026

    @m-natarajan

    Can't repro, company card feed from the other workspace is not displayed in the feed, Samsung A52 / Android 14 and iPhone 13 / iOS 26.4, v9.3.51-6 PR:86921 Ad-Hoc

    company.card.MP4
    feed.mp4
  9. added
    Daily
    and removed
    DeployBlockerCash
    Hourly
    on Apr 2, 2026
  10. melvin-bot commented on Apr 9, 2026

    @melvin-bot

    @narefyev91 Whoops! This issue is 2 days overdue. Let's get this updated quick!

  11. melvin-bot commented on Apr 13, 2026

    @melvin-bot

    @narefyev91 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  12. melvin-bot commented on Apr 15, 2026

    @melvin-bot

    @narefyev91 8 days overdue is a lot. Should this be a Weekly issue? If so, feel free to change it!

  13. melvin-bot commented on Apr 17, 2026

    @melvin-bot

    @narefyev91 10 days overdue. I'm getting more depressed than Marvin.

  14. linhvovan29546 commented on Apr 20, 2026

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

Metadata

Metadata

Labels

BugDailyEngineeringReviewing

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions