WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.36k stars 4.14k forks source link

Zoom out: cover block resize handler is misplaced #63522

Open ellatrix opened 2 months ago

ellatrix commented 2 months ago

Description

image

Step-by-step reproduction instructions

Open a pattern category in the inserter and select a cover block

Screenshots, screen recording, code snippet

No response

Environment info

No response

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

MaggieCabrera commented 1 month ago

I found a bug I think might be related to this. We are assuming all sectioning elements are going to be groups but in this case it isn't and it's not behaving as it should. Also bear in mind, one of the core patterns is a cover block without a wrapping group block, this is what happens:

Screen Capture on 2024-08-08 at 11-54-43

MaggieCabrera commented 1 month ago

In the case of the cover block, the handle is missplaced because the scaling from zoom out is not applying to it. I wonder if on zoom out it should be showing at all. We are working under the assumption that on zoom out mode all top level blocks are groups but that's not always the case, even more so on the post/page editor. The image block is also showing handles, for example, and the cover block is allowing for that drag and drop replacement of the image that I reported earlier. This is all expected behavior given that those top level blocks are not really locked. Should they if they are not group blocks?

MaggieCabrera commented 1 month ago

This is all expected behavior given that those top level blocks are not really locked. Should they if they are not group blocks?

Actually, top level blocks have getBlockEditingMode set to default, with everything inside them set to disabled. If we set the non group top level blocks to disabled the won't be selectable anymore, so that's not a good route to explore

scruffian commented 1 month ago

One option could be to apply the zoom out scaling to the handles.