Skip to content

feat(VFileUpload): add allowPaste prop to support pasting files from clipboard#22777

Open
mixelburg wants to merge 1 commit intovuetifyjs:masterfrom
mixelburg:feat/vfile-upload-paste-clipboard
Open

feat(VFileUpload): add allowPaste prop to support pasting files from clipboard#22777
mixelburg wants to merge 1 commit intovuetifyjs:masterfrom
mixelburg:feat/vfile-upload-paste-clipboard

Conversation

@mixelburg
Copy link
Copy Markdown
Contributor

Fixes #22732

Problem

There's no way to paste files (e.g. screenshots) directly into VFileUpload. Users have to paste into an image editor first, save the file, then drag-and-drop or browse for it.

Solution

Added an allowPaste boolean prop. When enabled, a paste event handler intercepts ClipboardEvent.clipboardData.files and passes them through the existing selectAccepted() flow — same path used by drag-and-drop and file browse selection.

<v-file-upload allow-paste multiple />

Users can now Ctrl+V / Cmd+V anywhere on the page when the component is focused to add files.

Implementation notes

  • Uses the same selectAccepted() path as drag-drop → file type filtering and rejected events work as expected
  • allowPaste defaults to false → fully backward-compatible
  • Guard: no-op when disabled is set
  • No paste handler is attached at all when allowPaste is false (no unnecessary event listener)

@J-Sek
Copy link
Copy Markdown
Contributor

J-Sek commented Mar 28, 2026

  1. read Docs » contributing » choosing-a-base-branch
  2. switch target to dev
  3. should support pasting folders

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Add area to v-file-upload to allow pasting from clipboard

2 participants