-
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
Update edit-save documentation #13578
Conversation
docs/designers-developers/developers/block-api/block-edit-save.md
Outdated
Show resolved
Hide resolved
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.
Might be worthwhile to get more eyes on this, but overall it seemed good to me!
docs/designers-developers/developers/block-api/block-edit-save.md
Outdated
Show resolved
Hide resolved
Co-Authored-By: mkaz <marcus@mkaz.com>
edit( { attributes, className } ) { | ||
return <div className={ className }>{ attributes.content }</div>; | ||
} | ||
``` | ||
{% end %} | ||
|
||
### isSelected | ||
|
||
The isSelected property is an object that communicates whether the block is currently selected. |
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 thought isSelected
was a boolean?
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.
Isn't a boolean an object too :-)
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.
It's 0
s and 1
s as well! The more specific, the better.
docs/designers-developers/developers/block-api/block-edit-save.md
Outdated
Show resolved
Hide resolved
Leaving a general comment here instead of commenting line by line. I saw some inconsistencies in how we declare ES5: edit: function( props ) {
...
}, ESNext: edit: ( props ) => {
...
}, |
docs/designers-developers/developers/block-api/block-edit-save.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/block-api/block-edit-save.md
Outdated
Show resolved
Hide resolved
Co-Authored-By: mkaz <marcus@mkaz.com>
Co-Authored-By: mkaz <marcus@mkaz.com>
Co-Authored-By: mkaz <marcus@mkaz.com>
(Dismissed my own review; if someone else approves I don't want my stale review to block a merge!) |
docs/designers-developers/developers/block-api/block-edit-save.md
Outdated
Show resolved
Hide resolved
docs/designers-developers/developers/block-api/block-edit-save.md
Outdated
Show resolved
Hide resolved
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.
Left a couple of comments that I'd like us to address. Other than that this is good to go.
This improves things a lot! 🌟
Co-Authored-By: mkaz <marcus@mkaz.com>
…rnmobile/372-use-RichText-on-Title-block * 'master' of https://github.com/WordPress/gutenberg: (22 commits) Make the modal title styling consistent (#13669) Disable navigation block for text mode. (#12185) Fix: Linting problem in modal example code (#13671) Add myself as a code owner to the annotations (#13672) Add more reviewers to CODEOWNERS.md file (#13667) Plugin: Remove jQuery heartbeat-to-hooks proxying (#13576) Workflow: Add repository CODEOWNERS file (#13604) Add a mobile minimum size for form fields (#13639) Update edit-save documentation (#13578) Alt image setting (#13631) Fix: Allow years lower than 1970 in DateTime component. (#13602) Using addQueryArgs to generate Manage All Reusable Blocks link (#13653) Bump plugin version to 5.0.0-rc.1 (#13652) Update lodash to 4.17.10 (#13651) Refreshed PR (#9469) Set default values of the width and height input fields according to the actual image dimensions (#7687) 12647 fix css color picker (#12747) Remove "we" from messages (#13644) Fix: Font size picker max width on mobile (#13264) Fix/issue 12501 menu item aria label ...
* Update edit examples with ES5 code * Add extra explanation and links to attributes and block tutorial * Add two examples for attributes, edit, save * Update docs/designers-developers/developers/block-api/block-edit-save.md Co-Authored-By: mkaz <marcus@mkaz.com> * Remove spaces. * Update docs/designers-developers/developers/block-api/block-edit-save.md Co-Authored-By: mkaz <marcus@mkaz.com> * Update docs/designers-developers/developers/block-api/block-edit-save.md Co-Authored-By: mkaz <marcus@mkaz.com> * Update docs/designers-developers/developers/block-api/block-edit-save.md Co-Authored-By: mkaz <marcus@mkaz.com> * Make function defns consistent across ES5/ESNext * Add clone example for ES5 * Update docs/designers-developers/developers/block-api/block-edit-save.md Co-Authored-By: mkaz <marcus@mkaz.com> * Simplify ES5 example, props @nosolosw
* Update edit examples with ES5 code * Add extra explanation and links to attributes and block tutorial * Add two examples for attributes, edit, save * Update docs/designers-developers/developers/block-api/block-edit-save.md Co-Authored-By: mkaz <marcus@mkaz.com> * Remove spaces. * Update docs/designers-developers/developers/block-api/block-edit-save.md Co-Authored-By: mkaz <marcus@mkaz.com> * Update docs/designers-developers/developers/block-api/block-edit-save.md Co-Authored-By: mkaz <marcus@mkaz.com> * Update docs/designers-developers/developers/block-api/block-edit-save.md Co-Authored-By: mkaz <marcus@mkaz.com> * Make function defns consistent across ES5/ESNext * Add clone example for ES5 * Update docs/designers-developers/developers/block-api/block-edit-save.md Co-Authored-By: mkaz <marcus@mkaz.com> * Simplify ES5 example, props @nosolosw
Description
edit()
documentationView branch documentation.
Fixes #4070
How has this been tested?
Confirm example code works as explained.
Types of changes
Documentation.