Sidebar styles tab crashes block when theme has >= 8 spacing values #64270
Labels
Global Styles
Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
[Priority] High
Used to indicate top priority items that need quick attention
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Description
Multiple blocks crash ("This block has encountered an error and cannot be previewed.") when clicking on the "styles" tab in the post editor, when the current theme has >= 8 spacing values.
The console is full of errors like:
Step-by-step reproduction instructions
settings.spacing.spacingSizes
in theme.jsonBlocks with the dimension control just in the sidebar (no tabs), like Quote, just crash immediately on adding.
Screenshots, screen recording, code snippet
I tested this with the
emptytheme
theme in gutenberg, updating the theme.json to the following to give me 8 spacing values.theme.json
The issue seems to be when it tries to fall back to the select control, when there are too many values for the range slider.
Environment info
Initially reported to me on wordpress.org here WordPress/wporg-main-2022#433 (comment), and https://core.trac.wordpress.org/ticket/61820
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
The text was updated successfully, but these errors were encountered: