gutenberg
gutenberg copied to clipboard
Classic Block: Can't select multiple lines of text and style them all at once
Description
When selecting multiple lines of text in a Classic block and then styling it using one of the toolbar options (like Bold, Italic, Alignment options) it only affects the first highlighted word or line.
Step-by-step reproduction instructions
- Create a new post
- Add a Classic Block
- Enter several lines of text separated by a Return
- Highlight all of the text
- Click the Bold link in the toolbar
- Highlight all of the text again
- Click the Center Alignment in the toolbar
Screenshots, screen recording, code snippet
I made a video here, but when I made the video, clicking Bold did not bold any of the text at all, so something changed between the time I found the bug originally and the time I created the video to reproduce it!
https://user-images.githubusercontent.com/5075840/165697167-5d523bb6-96d0-4dfc-b10d-56666d4393b3.mp4
Environment info
WordPress 5.9.3 Gutenberg 13.0.0
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
In addition to the styling options, this error also seems to apply when trying to "overwrite" selected text. If you select multiple lines of text and then try to type (in an attempt to replace what was selected with your new text), nothing happens—the selected text is not replaced.
Also, selecting exactly two lines (rather than just one or 3+) causes the selection to disappear entirely, and the caret jumps back to whatever line you had selected last. For example, if I click into the middle of line 2, then select any two lines, the selection immediately vanishes and the insertion point is back in the middle of line 2.
Here is a video of quotes not applying to multiple lines. I believe this related to the same issue;
https://user-images.githubusercontent.com/5075840/168214977-1987908b-6fee-42b3-b57a-3634c54dd500.mp4
- [ ] Reported here too: #5304320-zd
5460979-zd
Also, when selecting blocks, you cannot delete them either with backspace button or the delete button.
This is for for the iframed editors. We should probably do the same for non iframed: alway render the classic editor in a modal.