Empty InnerBlock renders empty div

This component instance has no blocks inside the InnerBlocks Block but it’s outputting an empty div.

I can create a Visibility toggle but it would be great if Component blocks didn’t render anything at all if there is no content.

It would save having to create a Visibility Toggle, which I have been doing a lot today

  • WordPress version: 6.4.3
  • Cwicly Plugin version: 1.4
1 Like

Just was starting to write a bug report for this when I saw your post. I really wonder if this is by design. And I can not imagine what it would be useful for in the CC backend?!
For me it is very annoying because I cannot determine if the Inner Blocks element is ampty or not on the frontend. Since the div gets replaced if you add a block you cannot tell if the div was added by the user or by CC.
@Louis, @Araminta, if it is necessary in the backend I would appreciate if it could be marked with a class or something so that I can differentiate it on the frontend.

Description:

When having an innerBlock (in a component) without inner blocks inside, then in the frontend an empty div is rendered.

Expected behavior: When no inner blocks are added, then no wrapper div is rendered. Maybe better never render a wrapper without being asked for…

Step-by-step reproduction instructions:

Add “Inner Blocks” to a page or component but do not add any blocks inside. In the frontend you will find an empty div.

Environment info

  • WordPress version: 6.4.3
  • Cwicly Plugin version: 1.4.0.2

Hi @grantambrose, @jan and @michelyweb,

Thank you for bringing this to our attention!

I have been able to reproduce this on my end, and can confirm it is a bug.
We’ll be sure to have a fix for this as soon as possible.

Apologies for the inconvenience.

3 Likes

@Araminta This seems to be fixed in 1.4.0.3:

Thank you Cwicly team!

2 Likes

Thank you for pointing this out, @StrangeTech!

Indeed, this should now be fixed with 1.4.0.3.

Moving to Fixed Bugs.

1 Like