-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Border Radius Control: Add fallback px unit and add utils tests #35786
Border Radius Control: Add fallback px unit and add utils tests #35786
Conversation
Size Change: +9 B (0%) Total Size: 1.07 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 looks great @andrewserong ✨
Love the extra test coverage. I think I found a small typo but other than that this LGTM 👍
✅ Code changes and tests look good
✅ All new tests pass
✅ No regression for the bug fix from #35651
✅ Split radius values continue to work correctly
packages/block-editor/src/components/border-radius-control/test/utils.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Aaron Robertshaw <[email protected]>
Thanks a lot for the follow-up, @andrewserong! The added test coverage is amazing 👏 |
Description
Based on feedback from @ockham, this PR re-implements the fix in #35651 for the Border Radius Control's fallback to
px
units, by moving the fix to thegetAllUnit
utils function. The changes here include:px
fallback togetAllUnit
.utils
module.mode
function to sort most common elements to the beginning of the array, and return the first element, to account for Array.sort() behaviour that always sortsundefined
to the end of an array.export
to themode
function so that we can test it directly.How has this been tested?
41undefined
in the code editor view)Screenshots
Types of changes
Non-breaking code quality change.
Checklist:
*.native.js
files for terms that need renaming or removal).