Pasting a paragraph replaces whole selected div target

Cwicly Plugin version:


When pasting a paragraph or some siple text previously selected with CTRL+C, pasting with CTRL+V totally replaces the selected div target:




Hi @yankiara,

This is not a bug, but more how Gutenberg works.
Feel free to move this to a feature request if you’d like to see it in Cwicly.


I don’t understand…

If I select a paragraph or image block in Gutenberg, then move the cursor somewhere else, then paste, it is inserted and it does NOT replace content (unless I select text, of course).

And with Cwicly, when we insert blocks with plus button or quick inserter, it does NOT replace container target either, blocks are just added.
Same when pasting divs or sections.

Simple text or image blocks paste behaviour should be the same, IMHO.

Tried with Cwicly sections, same issue:

  • add a section
  • copy some text somewhere
  • select section
  • paste
  • boom, no more section :frowning:

So how do you currently paste text/image in an existing container?
Do you paste at root level then move it?
Sounds like terrible ergonomics :wink:

Hello @yankiara,

Is this with Cwicly activated?

Please try with Cwicly deactivated. You will see that the default Gutenberg behaviour is to replace everything and anything.

Simply insert a paragraph block (that’s how the Gutenberg team intend you to work at least).

Once again, we try our best to connect the Gutenberg and Cwicly experiences together without overriding the Gutenberg one altogether.

I’m not quite sure I follow what you don’t understand :slight_smile:

Tested on clean WP install, and I totally disagree, Gutenberg does not replace content.

  1. Select text in a paragraph, copy, put cursor inside a paragraph, paste: text is inserted and doesn’t replace anything (hopefully!!!).

  2. Copy whole paragraph block, put cursor inside a paragraph, paste: paragraph block is inserted and splits the target paragraph into two paragraphs and doesn’t replace anything.

  3. Copy image block, put cursor inside a paragraph, paste, same behaviour, image is inserted and splits the target paragraph into two paragraphs and doesn’t replace anything.

I have never seen Gutenberg replace text when pasting, except when text is selected before pasting.

IMHO, it would be a nightmare if it did.

Pasting on an image block actually replaces the image, but this is different since we can’t put cursor inside image, clicking on it selects it, so I understand it is replaced.

That said, I can now understand that you consider clicking on div/section in structure panel selects it, then pasting replaces it.
But this is very unintuitive and anti ergenomic.

I’m pretty sure in 99% of cases, user wants to paste INSIDE a container and not replace it.

I know that and you made an incredible work with Cwicly, way beyond my first expectations :partying_face:

Are we not diverging from the original post?

You were selecting a div and wondering why it was replaced.
You now mention selecting and placing the caret in a paragraph block, which also happens with Cwicly blocks.
In fact, I’m not sure where Cwicly is acting differently from Gutenberg in these cases?

I was just trying to say that pasting on a div or section should act like pasting inside a paragraph because in most cases the user wants to insert content and not replace the container.

But it’s OK, I can live with inserting an empty paragraph and paste there.