-
Notifications
You must be signed in to change notification settings - Fork 385
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
Right-Click: Add options to cut/copy/paste blocks #2989
Comments
Special care will be needed for paste since access is restricted for security/privacy reasons. See https://developers.google.com/web/updates/2018/03/clipboardapi |
Testing details. User could be able to do the copying.
To test this, a test script that mixes and matches elements of this list should be created. An example would be, copy a block using keyboard and paste using the context menu. |
|
You should be able to copy a CTA block. I can't paste it in the same page, as you can only have one CTA per page. But you can copy and paste a CTA onto another page if you want. |
The cut via keyboard fix has now been merged. See #3231 |
…id bugs Fixes #2989. With this change, using the keyboard to cut a block, nothing visually happens, but the selected block is actually copied. Users can still right-click cut the block if they want. This must be fixed in a future ticket. See inline `todo` for a description of the issue.
Verified in QA |
Screencast can be found here - https://www.youtube.com/watch?v=47onOiC-EhU&feature=youtu.be |
As outlined in #2785, let's extend the block settings menu to offer cut + copy options, where the block content is added to the clipboard.
Cases where Gutenberg is adding blocks to the clipboard:
https://github.com/WordPress/gutenberg/blob/b95e865de32ee62d722be3e3e71b334a4b639032/packages/block-editor/src/components/copy-handler/index.js#L26-L57
https://github.com/WordPress/gutenberg/blob/b95e865de32ee62d722be3e3e71b334a4b639032/packages/components/src/clipboard-button/index.js#L27-L67
Pasting would be handled by the
RichText
component which we use in all the text-based blocks and has some complex logic for handling the clipboard data properly:https://github.com/WordPress/gutenberg/blob/03121c5e59c63d4c79a293f71bbb7b9613fd311c/packages/rich-text/src/component/index.js#L187-L260
We probably need to copy most of that component's logic.
The text was updated successfully, but these errors were encountered: