-
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
Experiment: Temporary hack to render blocks in customizer #29365
Experiment: Temporary hack to render blocks in customizer #29365
Conversation
Size Change: +3.92 kB (0%) Total Size: 1.39 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.
Nice work @kevin940726!
I see a few obvious issues, but nothing that I think should stop us merging this as this PR lets us iterate on the UI.
-
If you select a paragraph block at the bottom of the Customizer block editor, add a new paragraph block by pressing Enter, then type some text, it seems to create one new widget per keystroke.
-
Can't reorder or delete a block because the block toolbar disappears when you click on it.
-
Can't add a block because there's no inserter. See Blocks in Customizer: Implement slide-out inserter #29285.
-
Legacy Widget blocks don't load, as you say. Let's wait until Legacy Widget add support for widgets with attributes that can't be serialised into JSON #28902 before looking at this as the Legacy Widget block will need to be changed anyway.
@@ -135,7 +135,7 @@ export default class SidebarAdapter { | |||
}; | |||
} | |||
|
|||
addWidget( widget ) { | |||
addWidget( widget, index ) { |
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.
Maybe default this to something e.g. index = 0
?
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.
IMHO, this method should remain private, thus we don't need to assign defaults to make it easy to use. Instead, we should mark index
as required explicitly to prevent us from introducing unexpected bugs 😅 .
Description
Close #29283.
Add a temporary hack to render blocks in widgets customizer.
Editing blocks works, but adding a new block currently doesn't work as expected. Seems like adding a block in the original customizer already doesn't work?
Also the legacy widgets still don't render correctly.
How has this been tested?
Screenshots
Kapture.2021-02-26.at.15.56.25.mp4
Types of changes
New feature
Checklist: