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

Fix (icon list block): fix error on transform for saved icon list block #3285

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/block/icon-list-item/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export const settings = {
supports: {
anchor: true,
__experimentalSelector: 'li',
reusable: false,
stkSaveBlockStyle: false,
},
example,
edit,
Expand Down
4 changes: 3 additions & 1 deletion src/hooks/use-saved-default-block-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ export const useSavedDefaultBlockStyle = blockProps => {
} )

// Create and apply the innerBlocks.
if ( blockData.innerBlocks?.length ) {
// Do not do this for icon lists because it causes an error on transform.
// The icon list inner blocks are created by the icon list block itself. See src/blocks/icon-list/transforms.js
if ( blockData.innerBlocks?.length && name !== 'stackable/icon-list' ) {
const innerBlocks = createBlocksFromInnerBlocksTemplate( blockData.innerBlocks )
// We need to add unique Ids to prevent the default styles from getting applied.
recursivelyAddUniqueIdToInnerBlocks( innerBlocks )
Expand Down
Loading