Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export default function useClickSelection() {
const clickedClientId = getBlockClientId( event.target );

if ( event.shiftKey ) {
if ( startClientId !== clickedClientId ) {
// When selecting a single block in a document by holding the shift key,
// don't mark this action as multiselection.
if ( startClientId && startClientId !== clickedClientId ) {
node.contentEditable = true;
// Firefox doesn't automatically move focus.
node.focus();
Expand Down
7 changes: 1 addition & 6 deletions test/e2e/specs/editor/various/multi-block-selection.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,20 +291,15 @@ test.describe( 'Multi-block selection (@firefox, @webkit)', () => {
editor,
pageUtils,
} ) => {
// To do: run with iframe.
await editor.switchToLegacyCanvas();

Comment on lines -294 to -296
Copy link
Member Author

Choose a reason for hiding this comment

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

Test works without requiring a non-iframed canvas.

await editor.insertBlock( {
name: 'core/paragraph',
attributes: { content: 'test' },
} );

await editor.saveDraft();
await page.reload();
// To do: run with iframe.
await editor.switchToLegacyCanvas();

await page
await editor.canvas
.getByRole( 'document', { name: 'Block: Paragraph' } )
.click( { modifiers: [ 'Shift' ] } );
await pageUtils.pressKeys( 'primary+a' );
Expand Down
Loading