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

Individual patterns not scaled appropriately until after adding #38501

Closed
annezazu opened this issue Feb 3, 2022 · 4 comments · Fixed by #38516
Closed

Individual patterns not scaled appropriately until after adding #38501

annezazu opened this issue Feb 3, 2022 · 4 comments · Fixed by #38516
Assignees
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@annezazu
Copy link
Contributor

annezazu commented Feb 3, 2022

Description

Pulling from this original issue with scrollbars #37573, there now seems to be an issue where the height of the patterns preview is off. On my end with 5.9 sans Gutenberg, the experience is one where before adding the pattern, the height is off in the Inserter but, after adding it, the height shows up correctly.

Step-by-step reproduction instructions

  1. Open Inserter > Patterns tab.
  2. Scroll through and look at patterns noticing they are cut off.
  3. Add a cut off pattern.
  4. Open the Inserter > Patterns tab and notice the same pattern you added is the right height.

Screenshots, screen recording, code snippet

151056304-822258a4-8588-4d9e-a9d4-f033ce330549.mov

Environment info

  • WordPress 5.9
  • No Gutenberg.
  • TT2
  • MacOS
  • Chrome

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 [Feature] Inserter The main way to insert blocks using the + button in the editing interface [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced labels Feb 3, 2022
@WhiteHeatherClub
Copy link

Patterns that are previewed incorrectly never appear correctly in the inserter for me, even after adding to the page. With latest Gutenberg plugin things are better - but not perfect. Correct aspect ratio is previewed, but very long patterns are being cut off.

2022-02-03.22-23-12.mp4.mp4

@jasmussen
Copy link
Contributor

Wanted to crosslink this with #38181 which may well help. Notably for any devs looking at this, I would point to @ixkaito's assessment of why the scaling issue happens, in case it helps debugging:

The following image shows the reason for the race condition with the expanding patterns.

38181

The race condition occurs with full-height blocks with vertical margins and also blocks with a height over than 100vh, so it seems that we still need to set a max height to the viewport (iframe).

Thank you @ixkaito!

@ellatrix
Copy link
Member

ellatrix commented Feb 4, 2022

For me it just seems to take a few seconds to load, but after that it expands to fit the content correctly 🤔
Is it just that there's a delay in loading the preview, or does it stay collapsed for you?

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Feb 4, 2022
@annezazu
Copy link
Contributor Author

annezazu commented Feb 4, 2022

It stays collapsed for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants