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

Zoom out: cover block resize handler is misplaced #63522

Closed
ellatrix opened this issue Jul 13, 2024 · 5 comments · Fixed by #65731
Closed

Zoom out: cover block resize handler is misplaced #63522

ellatrix opened this issue Jul 13, 2024 · 5 comments · Fixed by #65731
Labels
[Feature] Zoom Out [Type] Bug An existing feature does not function as intended

Comments

@ellatrix
Copy link
Member

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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

@getdave
Copy link
Contributor

getdave commented Oct 1, 2024

We are assuming all sectioning elements are going to be groups

I checked this and the logic no longer makes any assumptions about the block type of the actual sections themselves. These are defined as the immediate child blocks of the "section root block" (i.e. sectionRootClientId).

The only criteria in play for the Template post type, is that the "section root block" must be:

  • a core/group.
  • must have a <main> tag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Zoom Out [Type] Bug An existing feature does not function as intended
Projects
Development

Successfully merging a pull request may close this issue.

4 participants