-
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
Block Editor: Add documentation for SpacingSizesControl component #68581
base: trunk
Are you sure you want to change the base?
Block Editor: Add documentation for SpacingSizesControl component #68581
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. |
return ( | ||
<View className="tools-panel-item-spacing"> | ||
<SpacingSizesControl | ||
values={ { all: value } } |
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.
I don’t see where this all
key is supported. I got here from testing #68339 so I even tried this with that story and it didn’t cause errors but also didn’t seem to do anything. It looks like this ought to be one of top
, right
, bottom
, left
. It’s probably best to use them all just for a complete example even though its seems they are all optional.
const handleOnChange = ( unprocessedValue ) => { | ||
onChange( unprocessedValue.all ); | ||
}; |
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.
I think it’d be fine to not have the wrapper and simply pass onChange
onto SpacingSizesControl
. At the least, the unprocessedValue.all
seems like it shouldn’t be there (per my other comment about all
not being a supported part of the API).
On the other hand, if it seems nice to demonstrate what the received value will consist of it could be something like this:
const handleOnChange = ( unprocessedValue ) => { | |
onChange( unprocessedValue.all ); | |
}; | |
const handleOnChange = ( { top, right = '0px', bottom, left = '0px' } ) => { | |
onChange( { top, right, bottom, left } ); | |
}; |
Hi @stokesman, |
Related to: #22891
Closes: #52070
What?
Adds documentation for the SpacingSizesControl component by:
Why?
The SpacingSizesControl component currently lacks documentation, making it difficult for developers to understand and implement the component correctly:
The documentation follows established patterns from other components while providing specific details relevant to SpacingSizesControl, making it easier for developers to use this component effectively in their blocks.