enonic / app-contentstudio

Content Studio of Enonic XP
GNU General Public License v3.0
11 stars 4 forks source link

Empty region placeholder remains in DOM after components added to the region #7609

Open alansemenov opened 1 month ago

alansemenov commented 1 month ago

When a region is empty, we display the placeholder div with text "Drop here" inside. When components get added to the region, the placeholder remains in DOM and gets hidden via CSS. This breaks styling that targets last-child element of the region container since the last child is technically the hidden placeholder element. This problem caused for example this issue.

Fix it so that placeholder element gets removed from the DOM whenever first component is added to a region. Make sure it gets re-added whenever the last component is deleted from a region.

Empty region with only placeholder:

image

Region with a part (followed by the hidden placeholder):

image