Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.42k stars 1.99k forks source link

Classic Block: Can't select multiple lines of text and style them all at once #62998

Open ccwalburn opened 2 years ago

ccwalburn commented 2 years ago

Quick summary

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.

Steps to reproduce

  1. Create a new post
  2. Add a Classic Block
  3. Enter several lines of text separated by a Return
  4. Highlight all of the text
  5. Click the Bold link in the toolbar
  6. Highlight all of the text again
  7. Click the Center Alignment in the toolbar

What you expected to happen

I expected all of the text to be bold and center aligned.center-aligned

What actually happened

Only the first word of the text was bold, and only the first line of text was center aligned.center-aligned

Context

5163900-zen I've seen it happen with Twenty Seventeen, Independent Publisher 2, and Marl

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/32983813/164988441-22ea006f-e7ea-408d-a948-3e56502bf6bf.mp4

Simple, Atomic or both?

Simple, Atomic

Theme-specific issue?

No response

Browser, operating system and other notes

No response

Reproducibility

No response

Severity

No response

Available workarounds?

Yes, easy to implement

Workaround details

The workaround is to use the Classic Editor from the WP Admin dashboard if the post doesn't need any other block types. If it does, then the lines must be styled individually.

Greatdane commented 2 years ago

I can reproduce on core also, made a bug report there; https://github.com/WordPress/gutenberg/issues/40676

thekingsprojects commented 2 years ago

Another case here: 30410063-hc (follow-up: 5187419-zen)

The issue the user actually came to chat to report was that they also can't overwrite the selected text—if they want to select multiple lines and then type new text directly "over" them, nothing happens. When I was testing to confirm the user's issue, I noticed that the style issue also applies. So it seems like this is an issue with performing any action at all with selected text.

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.

I'll add these observations to the core issue report as well.

thekingsprojects commented 2 years ago

Another case here: 5190355-zen