-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Global Styles: fix console error in block preview #59112
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: -9 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
Flaky tests detected in 357a675. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7925809555
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @t-hamano!
Thank you |
* trunk: (78 commits) Components: Use `Element.scrollIntoView()` instead of `dom-scroll-into-view` (#59085) DataViews: Correctly display featured image that don't have image sizes (#59111) Elements: Fix block instance element styles for links applying to buttons (#59114) Allow editing of image block alt and title attributes in content only mode (#58998) Add toggle for grid types and stabilise Grid block variation. (#59051) Global Styles: fix console error in block preview (#59112) Navigation: Avoid using embedded records from fallback API (#59076) Refactor responsive logic for grid column spans. (#59057) Editor: Unify Mode Switcher component between post and site editor (#59100) Move StopEditingAsBlocksOnOutsideSelect to Root (#58412) Fix logic error in #58951 (#59101) Block-editor: Auto-register block commands (#59079) Fix small typo in rich text reference guide (#59089) Components: Add lint rules for theme color CSS var usage (#59022) Enter editing mode via Enter or Spacebar (#58795) Updating Storybook to v7.6.15 (latest) (#59074) CustomSelectControl (v1 & v2): Fix errors in unit test setup (#59038) Add stylelint rule to prevent theme CSS vars outside of wp-components (#59020) ColorPicker: Style without accessing InputControl internals (#59069) Pattern block: batch replacing actions (#59075) ...
Should we backport this fix to 6.5? |
The bug that this PR resolves is not one that was first introduced in WP6.5, so I think either is fine. |
It a small non impactful change, so let's just make 6.5 a bit better. |
Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: annezazu <annezazu@git.wordpress.org> Co-authored-by: carolinan <poena@git.wordpress.org>
I just cherry-picked this PR to the more/backports-for-beta3 branch to get it included in the next release: ea8ea99 |
Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: annezazu <annezazu@git.wordpress.org> Co-authored-by: carolinan <poena@git.wordpress.org>
Fixes #58884
What?
This PR fixes a console error that the block preview outputs when selecting some blocks in the global styles.
5cbf444f54ed2bd39dc83fa70bebcb7c.mp4
Why?
In #47697, the value of
minHeight
prop was adjusted to prevent infinite rendering of block previews. Although this value is a string, theBlockPreview
component expects this value to be a number in one place:gutenberg/packages/block-editor/src/components/block-preview/auto.js
Lines 106 to 109 in 0e899f7
As a result, if "scale" is a decimal value, for example, the following calculation returns NaN.
How?
I changed it from
150px
to the numerical value150
.Testing Instructions
SCRIPT_DEBUG
is set totrue
in advance. If you are using wp-env, it should betrue
by default.