Add ability to paste file upload

Created on 2 October 2023, about 1 year ago
Updated 19 October 2023, about 1 year ago

Problem/Motivation

We are unable to paste files to upload.

Steps to reproduce

  1. Copy an image from somewhere to your clipboard.
  2. Visit Content > Media > Add Media > Image.
  3. Click next to the image upload field to "activate" it.
  4. Press Ctrl+V to paste your image.

If this feature enhancement was present, the file would upload from the clipboard.

Note: the "Click next to..." thing is explained below. But the general idea is that when you have a file field, it would be a practical and simple UX feature enhancement to be able to paste an image from your clipboard.

Proposed resolution

The paste event is well supported in browsers. Add ability to paste a file to a file upload field.

Remaining tasks

  • [x] Accept pasted files to file upload fields.
  • [x] Auto-upload on paste event.
  • [ ] Indicate the active file field accepting paste events.
  • [ ] If possible, add a Paste option to right-click menu.
  • [ ] Add tests.

User interface changes

The paste event seems to occur for an "active" DOM element. But, there's no indication whether the file field is active or not. Local tests suggest that clicking near or next to the file field "activates" it for paste events. While after clicking elsewhere on the page, the paste event for a given file field is not fired. The paste event can also be captured by higher objects, all the way up to the window object.

Release notes snippet

TBD

โœจ Feature request
Status

Active

Version

11.0 ๐Ÿ”ฅ

Component
File systemย  โ†’

Last updated about 11 hours ago

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States jcandan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024