-
Notifications
You must be signed in to change notification settings - Fork 382
Closed
Labels
BugSomething isn't workingSomething isn't working
Milestone
Description
Bug Description
When a user goes to paste an item, upon the paste action the item does not always paste on the top layer.
Expected Behaviour
Pasted item would always be the top layer when pasted.
Steps to reproduce
- Copy a block
- Paste a block
Screenshots
Additional context
- WordPress version:
- Plugin version: 1.3-rc
- Gutenberg plugin version (if applicable):
- AMP plugin template mode:
- PHP version:
- OS:
- Browser: [e.g. chrome, safari]
- Device: [e.g. iPhone6]
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- Pasted blocks should be on the top most layer of the page, i.e. in the block navigation it would appear at the top, not the bottom.
Implementation brief
Blocks are inserted when pasting in two places:
| insertBlocks( ensureAllowedBlocksOnPaste( content, pageClientId, isFirstPage ), null, pageClientId ).then( ( { blocks } ) => { |
and
| insertBlocks( ensureAllowedBlocksOnPaste( content, clientId, isFirstPage ), null, clientId ); |
In both cases, the index where to set the block is currently set to null. We should replace that with an appropriate index to ensure that the block is pasted to the last position.
QA testing instructions
Using context menu
- Add an image to a story.
- Right click the image and select "cut".
- Add a text block to the same page.
- Right click the page just above the text block and select "paste".
- Verify that the image is pasted on top of the text block, not below.
Using keyboard
- Add an image to a story.
- Make sure the image has focus.
- Press ctrl-x/cmd-x to cut the image from the page.
- Add a text block to the same page.
- Make sure the page has focus.
- Press ctrl-v/cmd-v to paste the image to the page.
- Verify that the image is pasted on top of the text block, not below.
Demo
Changelog entry
- Changed behavior so that pasted elements are always inserted at the top
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugSomething isn't workingSomething isn't working


