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

CommentFileSizeAuthor
Screen Recording 2025-07-18 at 15.03.33.mov22.25 MBblyme
Command icon 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

blyme created an issue. See original summary.

hhvardan’s picture

Assigned: Unassigned » hhvardan

hhvardan’s picture

Assigned: hhvardan » Unassigned
Status: Active » Needs review

Updated 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.

blyme’s picture

Status: Needs review » Reviewed & tested by the community

Thanks 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.

  • hhvardan committed c89b5495 on 1.0.x
    Issue #3536849 by hhvardan, blyme: Issue with multiple paragraph fields
    
hhvardan’s picture

Status: Reviewed & tested by the community » Fixed

Thanks 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.