[Feature Request] Allow dragging images into textareas #6999

Closed
opened 2025-11-02 07:13:11 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @delvh on GitHub (Mar 13, 2021).

  • Gitea version (or commit ref): 1.14.0+dev-841-g3c7582061

Description

GitHub allows to drag images from the dragboard directly into any text area instead of dragging it to an upload section below which seems more intuitive to understand and with less code necessary.

What to implement

Also give the textarea the ability to accept dragged images, and insert them not as an attachment, but as part of the message (meaning basically the same behavior as when "Ctrl + V" was pressed with an image in the clipboard).

GitHub even went so far as to completely integrate the "upload section" of a textarea into the textarea itself, resulting in a smaller webpage being displayed.
This could also be considered (maybe later on), as the only purpose of the upload section, once this gets implemented, is to open the file system dialog, and nothing else.

Screenshots

Current appearance:
image

Appearance when using manual attachments versus ![image] (at the top):
image

Originally created by @delvh on GitHub (Mar 13, 2021). - Gitea version (or commit ref): 1.14.0+dev-841-g3c7582061 ## Description GitHub allows to drag images from the dragboard directly into any text area instead of dragging it to an upload section below which seems more intuitive to understand and with less code necessary. ## What to implement Also give the textarea the ability to accept dragged images, and insert them not as an attachment, but as part of the message (meaning basically the same behavior as when "Ctrl + V" was pressed with an image in the clipboard). GitHub even went so far as to completely integrate the "upload section" of a textarea into the textarea itself, resulting in a smaller webpage being displayed. This could also be considered (maybe later on), as the only purpose of the upload section, once this gets implemented, is to open the file system dialog, and nothing else. ## Screenshots Current appearance: ![image](https://user-images.githubusercontent.com/51889757/111022748-03cd7000-83d5-11eb-9110-7e430b8532f7.png) Appearance when using manual attachments versus `![image]` (at the top): ![image](https://user-images.githubusercontent.com/51889757/111022984-94588000-83d6-11eb-8c37-a16d78ff9c39.png)
GiteaMirror added the type/featureissue/duplicate labels 2025-11-02 07:13:11 -06:00
Author
Owner

@a1012112796 commented on GitHub (Mar 16, 2021):

I'm sorry, But in my opinion. pasting images into textareas has been implement in gitea. example:

tmp

Aren't it?

@a1012112796 commented on GitHub (Mar 16, 2021): I'm sorry, But in my opinion. ``pasting images into textareas`` has been implement in gitea. example: ![tmp](https://user-images.githubusercontent.com/25342410/111252234-a2630680-864b-11eb-8a1a-6abc5eec2de0.gif) Aren't it?
Author
Owner

@delvh commented on GitHub (Mar 16, 2021):

Okay, yes, I can verify that it is partially possible using "Ctrl + V":
It will work if the image was directly added to the clipboard.
However, if the image was simply added as a file link, nothing spectacular will happen, except that the link will be copied as plain text (this however is not necessarily a bug as GitHub has the same behavior when encountering a pasted file).
But, what is not possible is dragging images into a text area.
Although it will appear as if it could be dragged, nothing happens once the dragging gets released.
I'll change the title of the issue accordingly.

@delvh commented on GitHub (Mar 16, 2021): Okay, yes, I can verify that it is partially possible using "Ctrl + V": It will work if the image was directly added to the clipboard. However, if the image was simply added as a file link, nothing spectacular will happen, except that the link will be copied as plain text (this however is not necessarily a bug as GitHub has the same behavior when encountering a pasted file). But, what is not possible is dragging images into a text area. Although it will appear as if it could be dragged, nothing happens once the dragging gets released. I'll change the title of the issue accordingly.
Author
Owner

@tyroneyeh commented on GitHub (Jul 6, 2022):

This #20263 edit should fix the issue
Demo

https://user-images.githubusercontent.com/1255041/176474223-e4ad12fb-3bfb-4811-a0b2-12555965655b.mov

@tyroneyeh commented on GitHub (Jul 6, 2022): This #20263 edit should fix the issue Demo https://user-images.githubusercontent.com/1255041/176474223-e4ad12fb-3bfb-4811-a0b2-12555965655b.mov
Author
Owner

@anbraten commented on GitHub (Jan 16, 2024):

duplicate of #14291?

@anbraten commented on GitHub (Jan 16, 2024): duplicate of #14291?
Author
Owner

@github-actions[bot] commented on GitHub (Mar 1, 2024):

Automatically locked because of our CONTRIBUTING guidelines

@github-actions[bot] commented on GitHub (Mar 1, 2024): Automatically locked because of our [CONTRIBUTING guidelines](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#issue-locking)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6999