Skip to content
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

Custom block update rendering when reused #16614

Closed
nicpelletier opened this issue Jul 16, 2019 · 1 comment · Fixed by #27887
Closed

Custom block update rendering when reused #16614

nicpelletier opened this issue Jul 16, 2019 · 1 comment · Fixed by #27887
Labels
[Feature] Block API API that allows to express the block paradigm. [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) [Type] Bug An existing feature does not function as intended

Comments

@nicpelletier
Copy link

nicpelletier commented Jul 16, 2019

I developed a custom (Gutenberg) block that have to update is content on almost every block manipulation on the block editor.

It works great, mostly: i "listen" to changes with a wp.data.subscribe function and update the block attributes with wp.data.dispatch( 'core/block-editor' ).updateBlockAttributes.

The problem is that the blocks stop updating when converted to a reusable block or put in one (like a reusable group). It's fine in the reusable block manager, but the feature that let you edit a reusable block inside the post it is used on is like a frame that don't fire my wp.data.subscribe function.

How do i check for modifications in this "window" and update blocks inside it?

It's just a backend problem. The client side rendering is dynamic so it works fine.

I've searched a lot, and asked here ( where you can also find the code) : https://wordpress.stackexchange.com/questions/342753/custom-block-update-rendering-when-reused.

I'm an experienced WP developer, but pretty new to React so sorry if my vocabulary is off...

Thank you,

@swissspidy swissspidy added [Feature] Block API API that allows to express the block paradigm. [Type] Help Request Help with setup, implementation, or "How do I?" questions. labels Jul 16, 2019
@youknowriad
Copy link
Contributor

yes, I don't see how this problem could be solved because the reusable blocks work on a separate data module registry. I believe ideally the inline-editing for reusable blocks should be refactored or removed in favor of links to the edit page of reusable blocks potentially.

@youknowriad youknowriad added [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) [Type] Bug An existing feature does not function as intended and removed [Type] Help Request Help with setup, implementation, or "How do I?" questions. labels Jan 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. [Feature] Synced Patterns Related to synced patterns (formerly reusable blocks) [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants