Problem/Motivation
Let's say you have a paragraphs field on a node where certain paragraphs are allowed and another field where some other paragraphs are allowed - on the same node. If you then click "Copy to clipboard", it shouldn't be possible to insert a paragraph if the field doesn't allow it.
What happens now is that the entire paragraphs field is being replaced by the field that the inserted-paragraph belongs to.
Steps to reproduce
- Create a paragraph field on a node and include a specific paragraph
- Create a second paragraph field on same node and include another specific paragraph, that isn't the same as the previous step
- Add the node and insert paragraph in the two fields
- Save the node
- Go back to edit the node
- Copy the paragraph from the paragraph field where the "Paste from clipboard" button is hidden
- Insert the paragraph to the field where the "Paste from clipboard" is shown
I've attached a screen recording reproducing the issue
| Comment | File | Size | Author |
|---|---|---|---|
| Screen Recording 2025-07-18 at 15.03.33.mov | 22.25 MB | blyme |
Issue fork paragraphs_clipboard-3536849
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
hhvardan commentedComment #4
hhvardan commentedUpdated the paste from clipboard functionality so that the “Paste from clipboard” button is always visible in the UI, but it is disabled when the clipboard content is not allowed for the current field.
Paste action will not succeed if the content is not valid for the field.
Comment #5
blyme commentedThanks for the quick response! I can verify that the patch works, so I'm fine with the issue being closed when merged.
The patch makes it so that the user would have to reload the page in order for the "Paste from clipboard"-button to be active. If we could trigger it using AJAX, that would make the user experience much better.
Comment #7
hhvardan commentedThanks for testing! You’re right — the current patch requires a page reload to update the paste button state. I'll create a follow-up issue to improve UX by updating the clipboard state via AJAX.