-
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
Convert list block to component with bound controls #1059
Conversation
Incidentally this appears to resolve #916 |
blocks/library/list/index.js
Outdated
controls={ [ | ||
{ | ||
icon: 'editor-ul', | ||
title: wp.i18n.__( 'Convert to unordered' ), |
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.
aside: should we import those import { __ } from 'i18n';
blocks/library/list/index.js
Outdated
const { nodeName = 'OL', values = [] } = attributes; | ||
|
||
return [ | ||
<BlockControls |
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 you missed the focus
check here ;)
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 you missed the
focus
check here ;)
How embarrassing considering I'd just remarked on how I'd been okay with it in the previous pull request 😄
462310a
to
ab8523b
Compare
Rebased to resolve conflicts and in doing so addressed the two points of feedback. |
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.
LGTM 👍
Fixes #919
Related: #830
This pull request seeks to update the list block to track internal list type as component state, and the TinyMCE editor instance as an instance property on the class. Previously they were assigned into attributes which would both be serialized, but also caused Redux DevTools to crash the page. It takes advantage of controls rendering introduced in #830 to reference these component instance values in control click handlers.
Testing instructions:
There should be no regression in list behavior.
Confirm you are able to use Redux DevTools extension.