jgraph / drawio

draw.io is a JavaScript, client-side editor for general diagramming.
https://www.drawio.com
Apache License 2.0
39.69k stars 7.43k forks source link

Paste here does not work from another editor, only paste #2660

Closed chipbite closed 1 month ago

chipbite commented 2 years ago

Preflight Checklist

Paste here does not work from another editor, only paste works

Copy stuff from another editor/browser/instance of draw.io, can only paste using paste/ctrl-v, paste here paste:s whatever was last copied in the same diagram. Two clipboards that are not aligned when pasting from another instance, maybe?

This may be limited to when using an drawio/diagrams.net editor in confluence <-> and a web app editor.

To Reproduce

Edit: The issue is not consistently appearing, in some instances it works as expected.

  1. Open diagrams in two draw.io instances, A & B (two different browsers for example).
  2. Copy any object in A (ctrl-c) - call this object 1 ("local").
  3. Switch over to editor B, copy any object - lets call this object 2 ("another editor").
  4. Switch back to editor A.
  5. Select "Paste" (or press ctrl-v).

Expected behavior Object 2 is pasted. ActualCorrect: Object 2 is pasted.

  1. Select undo to remove object 2.
  2. Select "Paste Here"

Expected behavior Object 2 is pasted. ActualIncorrect: Object 1 is pasted. Different behavior from paste / Ctrl-v.

draw.io version (In the Help->About menu of the draw.io editor):

Desktop (please complete the following information):

Additional context Its been this way forever. Just haven't gotten around to reporting it. 😄 Note again: This is inconsistent, repro not clear.

mararad commented 2 years ago

Hi,

Could you attach video showing all steps and the result? I couldn't reproduce with diagrams.net 16.6.5. Tried using two diff browsers (Chrome Version 98.0.4758.102 (Official Build) (64-bit) and FF 97.0.1 (64-bit) Also tested wih 2 editors in Chrome and in both cases Pase here pasted object 2.

If you clear browser cache does it help?

chipbite commented 2 years ago

Hi! Here is a simple clip showing just the issue. small-example

It does not appear consistently. I do not know exactly how to setup to reproduce. It may be an issue between instances in confluence -> web? So far, I have not tested with different browsers, only chrome. The issue has been around for a looong time - over different chrome versions. So, I dont think chrome browser version is a key aspect.

chipbite commented 2 years ago

Longer example with workaround shown: longer-ex-w-workaround

mararad commented 2 years ago

We use different “clipboards” for copy/paste via keyboard and copy/paste via menus so “paste here” only works when copy was used from menu. Also the menu clipboard is only available in the same tab, the real (keyboard) clipboard is system-wide.

chipbite commented 2 years ago

No, you're wrong or inaccurate here.

We use different “clipboards” for copy/paste via keyboard and copy/paste via menus so “paste here” only works when copy was used from menu.

This statement is not accurate. Easy to check/verify:

Also the menu clipboard is only available in the same tab, the real (keyboard) clipboard is system-wide.

I dont quite understand this point, but since your first is not accurate, I suspect this one is also not accurate.

The issue remains, as it has for quite some time.

alderg commented 2 years ago

This works for me: Copy object 1 in Editor A, then copy object 2 in editor B, paste in Editor A pastes object 2, then undo and paste here in Editor A pastes object 2 (again) as expected.

chipbite commented 2 years ago

This works for me: Copy object 1 in Editor A, then copy object 2 in editor B, paste in Editor A pastes object 2, then undo and paste here in Editor A pastes object 2 (again) as expected.

Yes, that is correct, I tried to get across that this issue is not consistent. I get the point, I will clarify the report a bit to say that earlier/in the report, sorry for the confusion. I will also try a few things to see if I can identify some consistency for repro.

chipbite commented 2 years ago

Issue is perhaps tied to Confluence editor in some way?

Maybe the issue could be exarcebated or even caused by confluence editor <-> web editor?

My use case

A common (perhaps primary for me, even) use case for copying between editor is this: I have some work offline that I want to copy into the diagram editor in confluence. So I will open the diagram in confluence and paste into it, content from a web editor with some local/file content opened.

Repro: MS Edge, Confluence editor <-> web app editor

Just reproduced with edge, which I never use, and the issue is reproducible, image: image

Will also now try with firefox.

chipbite commented 2 years ago

Repro: Firefox, confluence <-> Webapp.

Using two firefox windows. Confluence drawio editor to the left and web app to the right. Paste here is not shown after just copying a shape from the confluence editor.

ctrl-v works consistently, always.

image

After clipboard is filled locally in the right editor, paste here is shown: image

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. See the FAQ for more information.