Skip to content

[Bug]: Cc/Bcc fields hidden after navigating away from compose and returning, despite containing recipients #5

Description

@rkofficial786

Describe the bug

When composing an email with Cc and Bcc recipients, navigating to another route and returning to the compose window restores To, Subject, and body — but the Cc and Bcc fields are no longer visible, even though they contain recipients. This risks users unknowingly sending to hidden Bcc recipients, or assuming those recipients were removed.

Steps to reproduce

  1. Open compose (New mail)
  2. Click 'Cc' and 'Bcc' and add recipients to both
  3. Add a To recipient and a Subject
  4. Navigate to another route (e.g. Contacts)
  5. Return to the compose window / draft
  6. Observe: To and Subject are restored, but Cc and Bcc
    rows are not shown

Expected behavior

  • If the draft contains Cc or Bcc recipients, those fields must be visible on restore — visibility should be derived from content (showCc = ccRecipients.length > 0 || userToggledCc), not stored as an independent boolean that resets on remount
    -A field containing recipients must never be hidden

Screenshots

Image

Browser / OS

Chrome/Windows 11

Additional context

Likely cause: the Cc/Bcc visibility flags are local component state initialized to false on mount, independent of the restored draft values. Fix direction: initialize visibility from the restored draft (useState(() => draft.cc.length > 0)), or compute it instead of storing it.


💬 Discuss this issue on our Discord

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions