basecamp / basecamp/trix

Upload to Active Storage when paste images with CTRL + V

Open
#1,171 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
20k
Forks
1.1k
Avg merge
3d 12h
Merged PRs (30d)
13

Description

Hello, I use Trix to create a chat on my website and I am having the following problem.

Users are copying images (Github, discord) and placing them using CTRL + V, however, the URL of these sites remains expired and over time the image is lost, giving the user the false impression that the image was sent.

I would like to know if there is any functionality that already does this upload when ctrl + v is pressed or if there is an event that I could listen to to download and send to Active Storage to persist in my backend.

When dragging and dropping the image on my machine it works, but I would like to upload images pasted using CTRL + V.

Below is a GIF exemplifying the image pasted with the Discord URL:

![pasting_on_trix](https://github.com/user-attachments/assets/cdb6d6fa-4b03-4783-98a2-e70985f7dfc3)

Here's a GIF of the functionality I'd like to have on Github:
![paste_github](https://github.com/user-attachments/assets/030b50f9-c345-4d60-a640-f16a0223ca02)

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no file, test, or entry point. Start by locating Trix's paste handling and existing drag-and-drop upload behavior, then determine whether pasted external images should be persisted through Active Storage; done would require an agreed behavior and corresponding tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.