-
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
Spacer: Fix unit settings filter #37774
Conversation
); | ||
const availableUnitSettings = ( | ||
useSetting( 'spacing.units' ) || undefined | ||
)?.filter( ( availableUnit ) => availableUnit !== '%' ); |
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.
We need to use undefined
and optional changing to apply defaults below.
Size Change: +14 B (0%) Total Size: 1.13 MB
ℹ️ View Unchanged
|
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.
This tests well!
Should be backported with #36186. |
Description
Fixes #37758.
The
useSetting( 'spacing.units' )
can returnfalse
, which isn't filterable.How has this been tested?
Types of changes
Bugfix
Checklist:
*.native.js
files for terms that need renaming or removal).