Skip to content

Pasting image directly from clipboard#1040

Merged
Spiral-Memory merged 2 commits intoRocketChat:developfrom
Pratheek555:ClipboardPaste
Mar 21, 2026
Merged

Pasting image directly from clipboard#1040
Spiral-Memory merged 2 commits intoRocketChat:developfrom
Pratheek555:ClipboardPaste

Conversation

@Pratheek555
Copy link
Contributor

@Pratheek555 Pratheek555 commented Dec 13, 2025

Brief Title

Acceptance Criteria fulfillment

  • When the message input is focused and the user presses Ctrl + V, any image present in the clipboard is detected.
  • Normal text pasting behavior remains unchanged when the clipboard contains text only.
  • Non-image clipboard content (e.g., PDFs or unsupported files) does not trigger the image upload flow.

Fixes #1039

Video/Screenshots

EmbeddedChat._.Simple.-.Simple.Storybook.-.Brave.2025-12-13.12-05-56.mp4

PR Test Details

Note: The PR will be ready for live testing at https://rocketchat.github.io/EmbeddedChat/pulls/pr-1040 after approval. Contributors are requested to replace <pr_number> with the actual PR number.

@Spiral-Memory
Copy link
Collaborator

Pls resolve conflicts

@Spiral-Memory Spiral-Memory added the nudge minor tweaks suggested label Mar 21, 2026
@Pratheek555
Copy link
Contributor Author

Hey @Spiral-Memory

I have resolved the conflicts.

return;
}

const items = Array.from(clipboardData.items);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, isn't there a well known and lightweight library to handle this, as we may miss some cases

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can take it as part of separate PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure will look into it as a part of another PR.

Thank you for taking your time to review the PR :)

Copy link
Collaborator

@Spiral-Memory Spiral-Memory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Spiral-Memory Spiral-Memory added chore a subtle fix and removed nudge minor tweaks suggested labels Mar 21, 2026
@Spiral-Memory Spiral-Memory merged commit 31c86d7 into RocketChat:develop Mar 21, 2026
6 of 7 checks passed
github-actions bot added a commit that referenced this pull request Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore a subtle fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Enable users to paste images directly into the chat input using Ctrl + V

2 participants