Allow pasting copied paragraph with "Paragraph actions"/ improve validation

Created on 20 June 2025, about 1 month ago

Problem/Motivation

It would be nice to directly paste the clipboard content below a specific position within the paragraphs field. This could be achieved by using the "paragraph actions menu" similar to the "Duplicate" functionality.
By using the actions menu, this would also solve the problem mentioned in πŸ› Doesn't work with "Add mode: Modal form" Active and general usability while using the Modal plugin.

Proposed resolution

  • add new action Paste clipboard below
  • validation - show action only, if paragraph type is allowed within paragraph field

I'll work on the issue and provide a MR with the changes.

✨ Feature request
Status

Active

Version

1.0

Component

User interface

Created by

πŸ‡©πŸ‡ͺGermany SteffenR Germany

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @SteffenR
  • πŸ‡©πŸ‡ͺGermany SteffenR Germany
  • πŸ‡©πŸ‡ͺGermany SteffenR Germany
  • πŸ‡©πŸ‡ͺGermany SteffenR Germany
  • Pipeline finished with Failed
    about 1 month ago
    Total: 199s
    #527257
  • Pipeline finished with Success
    about 1 month ago
    #527282
  • πŸ‡©πŸ‡ͺGermany SteffenR Germany
  • Pipeline finished with Success
    about 1 month ago
    Total: 155s
    #527363
  • πŸ‡©πŸ‡ͺGermany SteffenR Germany
  • πŸ‡©πŸ‡ͺGermany SteffenR Germany
  • Pipeline finished with Success
    about 1 month ago
    Total: 179s
    #528976
  • πŸ‡¦πŸ‡²Armenia hhvardan

    Marking this issue as "active" due to ongoing updates. Thanks for your work on it.

    Adding a β€œPaste below” option to the paragraph actions menu β€” doesn’t align well with how the module is designed. The actions menu is meant for operations on that paragraph (like edit, duplicate, remove), while the clipboard is global and not linked to any specific paragraph. This could be confusing to users.

    If you’d like to add this feature, please consider making it optional (behind a setting, like "add above") so site builders can choose whether to enable it.

  • πŸ‡¬πŸ‡§United Kingdom andy inman Gloucestershire, UK

    @steffenr I took a quick look at what you have implemented. I think it's a great idea - I agree that it's useful.

    I also agree with hhvardan - it may be confusing to users. One suggestion - a small change that I think would help: make the menu item show Insert from clipboard rather than the current text, Paste clipboard below. Reason: for me, this better explains what is going to happen. Sure, it doesn't tell you whether the item will be pasted above or below, but I don't think that matters much. Insertion below the currently selected paragraph is what I would expect.

    • Copy to clipboard - makes sense already.
    • Paste from clipboard - not good - I might expect it to replace the current item.
    • Insert from clipboard - Makes sense to me.
  • Pipeline finished with Success
    about 1 month ago
    Total: 221s
    #530769
  • πŸ‡©πŸ‡ͺGermany SteffenR Germany

    @hhvardan @andy inman Thx for your feedback.
    Renaming the action is not "a big deal" and as you mentioned, it sounds like it makes more sense.

    I've updated the MR accordingly. Maybe you can have an idea, how to get the configured third party setting within the hook_paragraphs_widget_actions_alter.
    I did some debugging, but it looks like there is no easy way (besides loading the whole widget configuration) to get the widget config/ third party settings in here.

  • πŸ‡©πŸ‡°Denmark blymemikkel Copenhagen

    I think the patch has an issue if the entity has more than one paragraphs field.

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

Production build 0.71.5 2024