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 changed the title Block editor: allow paste on multiple selected blocks Writing flow: allow paste on multiple selected blocks Nov 27, 2019
@ellatrix ellatrix force-pushed the try/multi-select-paste branch from 9b9edcd to 515f377 Compare Dec 6, 2019
@ellatrix ellatrix force-pushed the try/multi-select-paste branch from 515f377 to 874720f Compare Dec 6, 2019
@ellatrix ellatrix force-pushed the try/multi-select-paste branch from 874720f to 1879822 Compare Dec 6, 2019
mcsf
mcsf approved these changes Dec 6, 2019
Copy link
Contributor

@mcsf mcsf left a comment

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

// behaviour.
return;
}
}
Copy link
Contributor

@mcsf mcsf Dec 6, 2019

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

@ellatrix ellatrix Dec 6, 2019

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
2 checks passed
@ellatrix ellatrix deleted the try/multi-select-paste branch Dec 6, 2019
@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