Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paragraph: paste contents at cursor point rather than as new blocks #53076

Closed
annezazu opened this issue Jul 27, 2023 · 7 comments · Fixed by #54543
Closed

Paragraph: paste contents at cursor point rather than as new blocks #53076

annezazu opened this issue Jul 27, 2023 · 7 comments · Fixed by #54543
Labels
[Block] Paragraph Affects the Paragraph Block [Feature] Paste [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Type] Bug An existing feature does not function as intended

Comments

@annezazu
Copy link
Contributor

annezazu commented Jul 27, 2023

Hat tip @richtabor for the text and video: When selecting, copying, and pasting, across more than one paragraph block, the selected contents are not pasted at the cursor point. Unexpectedly, the contents are pasted as new blocks.

The expectation is that one pastes the copied contents of more than one block, right where the cursor is. The contents should inherit the attributes of the pasted-in paragraph.

CleanShot.2023-07-27.at.15.27.21.mp4

cc @ellatrix for consideration as you weave your way through writing flow issues.

@annezazu annezazu added [Feature] Paste [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Block] Paragraph Affects the Paragraph Block labels Jul 27, 2023
@jordesign jordesign added the [Type] Bug An existing feature does not function as intended label Jul 28, 2023
@ellatrix
Copy link
Member

ellatrix commented Aug 8, 2023

Could you elaborate more on what you're expecting? Yes, currently, for multiple blocks, we split the paragraph into two at the caret, and then insert the pasted blocks in between.

Do you expect all content to be inlined? Do you expect only the first pasted block to be merged with the first split block, and then last pasted block to be merged with the end of the split?

More visually:

This is your clipboard:

Paragraph one

Paragraph two

Paragraph three

This is your content with a caret:

Existing‸ post.

What do you expect when you paste the two paragraphs?

What happens now:

Existing

Paragraph one

Paragraph two

Paragraph three

 post.

Is this what you expect?

ExistingParagraph one

Paragraph two

Paragraph three post.

@richtabor
Copy link
Member

Is this what you expect?

CleanShot 2023-08-09 at 21 55 59

Yes. :)

@ellatrix
Copy link
Member

ellatrix commented Oct 4, 2023

@richtabor What if you replace Paragraph one with a heading Heading one? What should happen? My current PR does this:

Existing

**Heading one**

Paragraph two

Paragraph three post.

@richtabor
Copy link
Member

Into

If pasting into an existing paragraph block, I'd expect the new contents to inherit the new block:

<p>Existing‸ post.</p>

with a clipboard of

<h2>Heading one</h2>
<p>Paragraph two</p>
<p>Paragraph three.</p>

to be

<p>ExisitingHeading one post.</p>
<p>Paragraph two</p>
<p>Paragraph three.</p>

Replace

If replacing an existing paragraph block entirely, I'd expect the origin contents to remain in as intended. Below I'm emulating selection on the entire first paragraph block.

[<p>Existing post.</p>]

with a clipboard of

<h2>Heading one</h2>
<p>Paragraph two</p>
<p>Paragraph three.</p>

to be

<h2>Heading one</h2>
<p>Paragraph two</p>
<p>Paragraph three.</p>

@ellatrix
Copy link
Member

ellatrix commented Oct 4, 2023

Yeah, then there's also the difference when selecting the contents of a paragraph vs the paragraph.

Ok, and what if you paste into a heading? :)

@richtabor
Copy link
Member

Ok, and what if you paste into a heading? :)

I think it's fine to work exactly the same way as above, where the difference is replace v. inserting within.

@ellatrix
Copy link
Member

ellatrix commented Oct 5, 2023

@richtabor No, I meant for the first case, if you have a collapsed selection. Should the heading disappear for the second part?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Paragraph Affects the Paragraph Block [Feature] Paste [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Type] Bug An existing feature does not function as intended
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants