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

Transform menu preview cut off or showing scrollbars #43829

Closed
annezazu opened this issue Sep 2, 2022 · 2 comments · Fixed by #44076
Closed

Transform menu preview cut off or showing scrollbars #43829

annezazu opened this issue Sep 2, 2022 · 2 comments · Fixed by #44076
Assignees
Labels
General Interface Parts of the UI which don't fall neatly under other labels. [Type] Bug An existing feature does not function as intended

Comments

@annezazu
Copy link
Contributor

annezazu commented Sep 2, 2022

Description

The preview for various transforms are either cut off or show a scrollbar randomly. This was found as part of the sixteenth FSE Outreach Program's call for testing:

Another time, when I was looking to transform a heading, the “preview” would sometimes be cut off. You can see this in the below video, especially the preview for transforming it to a paragaph. What’s odd is that hovering up and down over the different options, it sometimes displayed correctly and sometimes not.

Step-by-step reproduction instructions

  1. Add some text to a paragraph or list block. Ensure there are 4-5 lines or items.
  2. Open the transform menu and notice some of the options are cut off or show scrollbars.

Screenshots, screen recording, code snippet

Screen Shot 2022-09-02 at 3 19 55 PM

Screen Shot 2022-09-02 at 3 20 21 PM

Screen Shot 2022-09-02 at 3 20 16 PM

Screen Shot 2022-09-02 at 3 20 02 PM

Here's a video from a participant in the outreach program:

cut.off.mp4

Environment info

  • WordPress 6.0.2
  • GB 14.0.2
  • TT2

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

@annezazu annezazu added [Type] Bug An existing feature does not function as intended General Interface Parts of the UI which don't fall neatly under other labels. labels Sep 2, 2022
@t-hamano
Copy link
Contributor

t-hamano commented Sep 4, 2022

About the cut-off, I think it is due to the margin-top of the block.
One solution is to set the margin of the root block to 0, as shown below.

.block-editor-block-preview__content-iframe .is-root-container > .block-editor-block-list__block {
	margin: 0;
}
078bb1fde3750070b7eb54d4195ffc46.mp4

However, this approach will not work if the top margin is applied to a child block. (For example, the quote block may have a child paragraph block with margin-top.

We can apply __experimentalpadding to provide padding around the preview, but this would not be a perfect way to prevent cutoffs.

I'm looking for someone who knows a good approach 🙂

@talldan talldan self-assigned this Sep 12, 2022
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Sep 12, 2022
@talldan talldan moved this from Triage to In Progress in WordPress 6.1 Editor Tasks Sep 12, 2022
@talldan
Copy link
Contributor

talldan commented Sep 12, 2022

About the cut-off, I think it is due to the margin-top of the block.

Thanks for the hint! That helped immensely. I stumbled across a solution for this in #44076.

edit: also put together a fix for the scrollbar issue in #44079.

Repository owner moved this from In Progress to Done in WordPress 6.1 Editor Tasks Sep 13, 2022
@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
General Interface Parts of the UI which don't fall neatly under other labels. [Type] Bug An existing feature does not function as intended
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants