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

Consider replaceInnerBlocks instead of insertBlock for accordion #628

Closed
nicolad opened this issue Jun 30, 2019 · 3 comments
Closed

Consider replaceInnerBlocks instead of insertBlock for accordion #628

nicolad opened this issue Jun 30, 2019 · 3 comments

Comments

@nicolad
Copy link
Contributor

nicolad commented Jun 30, 2019

Is this enhancement related to a problem? Please describe.
When I started implementing social links for GB I took some inspiration from coblocks' accordion, more specific - the approach of adding new accordion item: https://github.com/godaddy/coblocks/blob/master/src/blocks/accordion/components/edit.js#L113

Describe the solution you'd like
Later I observed that in columns block of GB there is a different approach on adding nesting blocks items: https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/columns/edit.js#L215

Any thoughts?

@richtabor
Copy link
Contributor

Thanks for pointing this out @nicolad. Is there any particular reason we should do it like core has for the Columns block?

@nicolad
Copy link
Contributor Author

nicolad commented Jul 2, 2019

Thanks for pointing this out @nicolad. Is there any particular reason we should do it like core has for the Columns block?

With replaceInnerBlocks it is easier to reason about the fact that the context is related to nested blocks. ATM I am not aware of implementation differences, but will dive deeper as I will progress on core social links block PR.

@AnthonyLedesma
Copy link
Member

@nicolad Thank you for the contribution of bringing ideas to the table. Do you have any followup with this? Ill go ahead and close the issue if this is a question for a later date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants