Skip to content

Multi-selection: faulty click-and-drag text selection at edges and across blocks #53128

Closed
@eidolonnight

Description

Description

Click-and-drag selection at the edges of paragraph blocks and across blocks of varying types results in unexpected highlighting and selections.

As demonstrated in the attached video, when using click-and-drag selection, the highlighted selection in the editor may not represent the actual selection that will be copied/pasted. The typical highlight applies to entire blocks while the actual selection may be null, a subset of text, or some combination of nearby blocks.

Similarly, the editor may report "X blocks copied" while the blocks were in fact not copied.

This seems to be a long-standing bug. I had assumed for some time that this was a personal issue, plugin conflict, or browser extension incompatibility, but having taken the time to test in isolation, the issue remains. I've observed this since at least WordPress 6.1.

Shift-click selection does not appear to result in the same behavior.

Step-by-step reproduction instructions

  1. Create a new post or page
  2. Insert various paragraph blocks inter-mingled with other blocks
  3. Starting mid-paragraph, click and drag to the bottom edge of the block and into the next block
  4. Observe highlighted area
  5. Copy using keyboard shortcut
  6. Paste to verify clipboard contents

Screenshots, screen recording, code snippet

gutenberg-click-and-drag-selection-issue.mp4

Environment info

Replicated using:

  • Mac OS 13.4.1
  • WordPress 6.3
  • Chrome Version 114.0.5735.248 (Official Build) (arm64)
    • Safari 16.5.2 exhibits slightly different but still unexpected behavior

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    [Block] ParagraphAffects the Paragraph Block[Feature] Block Multi SelectionThe ability to select and manipulate multiple blocks[Feature] Writing FlowBlock selection, navigation, splitting, merging, deletion...[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions