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

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

Closed
eidolonnight opened this issue Jul 28, 2023 · 4 comments · Fixed by #64928
Closed
Labels
[Block] Paragraph Affects the Paragraph Block [Feature] Block Multi Selection The ability to select and manipulate multiple blocks [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Type] Bug An existing feature does not function as intended

Comments

@eidolonnight
Copy link

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

@eidolonnight eidolonnight added [Type] Bug An existing feature does not function as intended [Block] Paragraph Affects the Paragraph Block labels Jul 28, 2023
@annezazu annezazu added the [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... label Jul 31, 2023
@annezazu
Copy link
Contributor

@ellatrix I know you've looked into this and it seems to be intentional for now with some consideration to changing the behavior for multi-select. Curious for your thoughts.

@annezazu annezazu added the [Feature] Block Multi Selection The ability to select and manipulate multiple blocks label Jul 31, 2023
@annezazu annezazu changed the title Faulty click-and-drag text selection at edges and across blocks Multi-selection: faulty click-and-drag text selection at edges and across blocks Jul 31, 2023
@annezazu annezazu moved this to Needs Dev / Todo in WordPress 6.4 Editor Tasks Aug 30, 2023
@bph bph moved this from Needs Dev / Todo to Punted to 6.5 in WordPress 6.4 Editor Tasks Sep 18, 2023
@bph bph moved this to ❓ Triage in WordPress 6.5 Editor Tasks Nov 23, 2023
@annezazu
Copy link
Contributor

Noting another version of this same issue with a pattern:

multiselect.mov

This is using WP 6.6.1 and GB 19.0.

@ellatrix
Copy link
Member

Hi @eidolonnight!

This PR should fix the first issue you raised: #64928.

The issue with copying a paragraph + list block, I can't reproduce at the moment. I'd recommend creating a separate issue for that.

Yes, selecting from a paragraph into a list block will trigger full selection. This is a know limitation for now, until I have time to work on selection across different root blocks (the paragraph and list items don't share the same root, the list items are inside a list). I'm not sure if we have a tracking issue for that, so feel free to create one for that also.

@github-project-automation github-project-automation bot moved this from Punted to 6.5 to Done in WordPress 6.4 Editor Tasks Aug 30, 2024
@ellatrix
Copy link
Member

Please submit any remaining issues separately, thank you for the reports!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Paragraph Affects the Paragraph Block [Feature] Block Multi Selection The ability to select and manipulate multiple blocks [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Type] Bug An existing feature does not function as intended
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants