Skip to content

There is no paste option for Grid Area if area has only one item #15755

@stefanstankovic

Description

@stefanstankovic

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

13.1.1

Bug summary

If you create a Grid model that has one or more Areas where each Area has the ability to add only one type, then you will not be prompted to choose an Item for that Area but you will immediately get a dialog to create an Item because it is the only one available for that Area.

image

That's fine, but if you already have an Item in the Area, there is an option for Paste, but since the dialog where you can choose the Block is skipped, there are no paste options.

image

The possibility of copying exists directly on the Item, so it would be good to have the option for paste as well.

image

Specifics

No response

Steps to reproduce

To successfully reproduce this bug, you need to create 2 Grid blocks. One block can be a simple block that can only have text, while the other block should have an area where only the first block can be added, from 0 to an infinite number of times.

On the page, add a Grid and add block number two, then in the area of ​​that block, add several block number ones.

Copy block number one from the list of blocks.

By clicking on adding a new block, you will get a dialog to create a block.
The option for Paste is not possible.

Expected result / actual result

It would be good to have an additional check on line 863 in the file umbBlockGridPropertyEditor.component.js
if (availableTypes.length === 1 && vm.clipboardItems.length == 0)
Show Add a new block only if there is nothing in the clipboard. If an item exists in the clipboard, show the create dialog so the editor can use the clipboard or choose to create a new module.

I could fix that, but I'm not sure if it would be good to check if the clipboard contains the exact block that we can add in the area.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions