View Issue Details

IDProjectCategoryView StatusLast Update
0025959mantisbtattachmentspublic2025-04-13 16:02
Reportertedritheni Assigned Toatrol  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionno change required 
Summary0025959: Pasting images as attachments does not work in Safari and Edge
Description

Raising this as 0021797 was closed without comment and the issue remains

TagsNo tags attached.

Relationships

related to 0021797 closedsyncguru Add support for pasting images as attachments 
has duplicate 0025958 closeddregad pasting images as attachments does not work in edge 

Activities

dregad

dregad

2019-08-06 04:29

developer   ~0062516

@syncguru are you looking into this ? I think it should be fixed before 2.22.0 is released.

syncguru

syncguru

2019-08-06 13:26

developer   ~0062521

Last edited: 2019-08-06 14:40

@dregad- For Safari, I cannot reproduce this issue locally. I cannot test on Edge though.
It is not clear why this works for some and not the others. I think we need a more reliable test data about this and releasing it would provide that. I would advocate for releasing this despite these reports and the reason is that the change does not degrade current functionality when it does not work. I am committed to fixing this issue once I have a good repro before or after the release.

atrol

atrol

2025-03-22 06:24

developer   ~0070020

I tried 2.27.1 and current master on Firefox and Edge and found that pasting images does work if you first click in the area and close the file selection dialog.
It does not work without this unneeded / useless step.

atrol

atrol

2025-03-22 06:27

developer   ~0070021

@dregad are you able to reproduce on Safari?

dregad

dregad

2025-03-22 17:39

developer   ~0070023

Seems to work (Safari 17.6 / macOS 14.6). Also tested with Chromium 133.

atrol

atrol

2025-03-22 18:24

developer   ~0070024

You used the context menu paste option with keyboard focus in the note field.
That works also for me.
I get the issue when using Ctrl+V in the upload section.
Pasting this way works when reporting a new issues, but not when adding a note.

dregad

dregad

2025-03-22 19:25

developer   ~0070025

using Ctrl+V in the upload section

Not sure what you mean by "in the upload section".
In my opinion, pasting is expected in the textarea field(s) - effectively within the form containing the dropzone area. This works for me both with ctrl+v and right-click.
What is your expectation ? That Paste should work from anywhere on the page ?

atrol

atrol

2025-03-23 06:18

developer   ~0070026

This is what I mean with "upload section"
Move the cursor into this section.
I can paste using Ctrl+V on page bug_report_page.php, but not when adding a note in view.php.

upload.png (10,516 bytes)   
upload.png (10,516 bytes)   
dregad

dregad

2025-03-24 05:30

developer   ~0070027

The JavaScript event handler that processes image pasting is currently attached to the form in which the dropzone area (i.e. what you're calling the "upload section") is. This was explained by @syncguru in https://github.com/mantisbt/mantisbt/pull/1527#issuecomment-511613618:

I capture any paste event over the surface area of the form.

In bug_report_page.php, this form (id #report_bug_form) covers almost the whole page, and effectively includes all input fields, giving the impression that it works globally (but if you left-click somewhere on the navbar then hit ctrl-V you will notice that paste does not work either.

The behavior in view.php is different, because the page is made up of multiple forms, so ctrl-V is only active when the focus is somewhere on the #bugnoteadd form

See attached screenshots for illustration of the covered areas.

So IMO this feature currently works as designed, but if the expectation is for ctrl-V to work from anywhere on the page, then maybe this needs to be changed.

image.png (100,350 bytes)   
image.png (100,350 bytes)   
image-2.png (56,568 bytes)   
image-2.png (56,568 bytes)   
atrol

atrol

2025-03-24 10:36

developer   ~0070028

Thanks a lot for analyzing and explaining.

Now I understand also the strange behavior that just the first attempt to paste via Ctrl+V does not work.
Ultimately, it is more a topic around keyboard focus than the covered page area.
In bug_report_page.php, the focus is automatically set to the "Category" field / the #report_bug_form form.
In view.php you have to click into the note field to get the focus.
So my second attempt worked just as clicking in the upload area and closing the file selection dialog set the focus to #bugnoteadd form.

dregad

dregad

2025-03-24 12:50

developer   ~0070029

Ultimately, it is more a topic around keyboard focus than the covered page area

Almost, yes. The focus does not need to be on an actual input field. Ctrl-V will also work after you click with the mouse e.g. on the Note label or the section title (actually, anywhere within the form element).

Is your expectation that Paste should work from anywhere on the page ? I have not tested, but I'm sure that's feasible.

atrol

atrol

2025-03-24 15:22

developer   ~0070030

Is your expectation that Paste should work from anywhere on the page ?

No, even if this would be convenient, it would not be intuitive, and could be confusing.
E. g. on bug_report_page.php you press Ctrl-V in field "Steps To Reproduce" expecting something to add to this field, but get something added to the - depending on your screen size - invisible "Upload Files" field.

dregad

dregad

2025-03-25 03:17

developer   ~0070031

OK, then I won't spend time trying to make that work ;-)

Based on our discussion, do you think that this issue needs to remain open ? From my perspective it can be resolved as no change required.

atrol

atrol

2025-03-26 05:00

developer   ~0070036

Set to "resolved".
We might come back to the keyboard focus topic if we ever should offer images as part of an arbitrary text field.