You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Multi-selection: faulty click-and-drag text selection at edges and across blocks #53128
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
Create a new post or page
Insert various paragraph blocks inter-mingled with other blocks
Starting mid-paragraph, click and drag to the bottom edge of the block and into the next block
Observe highlighted area
Copy using keyboard shortcut
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.
@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.
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[/+]on Jul 31, 2023
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.
Activity
annezazu commentedon Jul 31, 2023
@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.
[-]Faulty click-and-drag text selection at edges and across blocks[/-][+]Multi-selection: faulty click-and-drag text selection at edges and across blocks[/+]annezazu commentedon Aug 17, 2024
Noting another version of this same issue with a pattern:
multiselect.mov
This is using WP 6.6.1 and GB 19.0.
ellatrix commentedon Aug 30, 2024
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.
ellatrix commentedon Aug 30, 2024
Please submit any remaining issues separately, thank you for the reports!