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 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 requested review from ajitbohra, gziolo, nerrad and ntwb as code owners 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
@ellatrix ellatrix force-pushed the try/multi-select-paste branch from 9b9edcd to 515f377 Dec 6, 2019
@ellatrix ellatrix force-pushed the try/multi-select-paste branch from 515f377 to 874720f Dec 6, 2019
@ellatrix ellatrix force-pushed the try/multi-select-paste branch from 874720f to 1879822 Dec 6, 2019
@mcsf
mcsf approved these changes Dec 6, 2019
Copy link
Contributor

mcsf left a comment

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

// behaviour.
return;
}
}

This comment has been minimized.

Copy link
@mcsf

mcsf Dec 6, 2019

Contributor

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

This comment has been minimized.

Copy link
@ellatrix

ellatrix Dec 6, 2019

Author Member

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
2 checks passed
pull-request-automation
Details
Travis CI - Pull Request Build Passed
Details
@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
You can’t perform that action at this time.