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

Writing flow: allow paste on multiple selected blocks #18746

Merged
merged 2 commits into from
Dec 6, 2019

Conversation

ellatrix
Copy link
Member

@ellatrix ellatrix commented Nov 26, 2019

Description

Fixes #17931.

Currently pasting on multiple selected blocks is buggy. It will leave the selected blocks and split one of them, pasting the content between the split pieces. This is because RichText is handling paste. Instead, the block editor should handle paste.

Adds e2e tests. Until now we did not have any e2e test for cut/copy/paste.

How has this been tested?

Select multiple blocks and paste.
Select a single block without putting focus somewhere and paste.

Screenshots

Types of changes

Bug fix

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR. .

@ellatrix ellatrix added [Feature] Block Multi Selection The ability to select and manipulate multiple blocks [Package] Block editor /packages/block-editor labels Nov 26, 2019
@ellatrix ellatrix added the [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... label Nov 26, 2019
@ellatrix ellatrix changed the title Block editor: allow paste on multiple selected blocks Writing flow: allow paste on multiple selected blocks Nov 27, 2019
Copy link
Contributor

@mcsf mcsf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels really nice! Let's get it in!

// behaviour.
return;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a super thorough block in terms of browser support :), what did you base it on?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of this is actually a copy from rich text. :) We'll need to find a way to allow this function to be reused.

@ellatrix ellatrix merged commit 68d7632 into master Dec 6, 2019
@ellatrix ellatrix deleted the try/multi-select-paste branch December 6, 2019 18:04
@youknowriad youknowriad added this to the Gutenberg 7.1 milestone Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block Multi Selection The ability to select and manipulate multiple blocks [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Package] Block editor /packages/block-editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pasting content while blocks are selected should overwrite selected blocks
3 participants