Each WordPress block Class attribute adds space to the HTML output when empty

Hi, I am quite new to Pingrow, trying out some different attributes for the Gutenberg block and noticed that if I add a couple of Class attributes as a Select box to add some utility classes but leave them empty when editing the page in WordPress, then each attribute adds a space in the frontend after the existing class, leading to ugly HTML.

It’s worth mentioning that I don’t want a default value, so if a particular attribute option is not selected, then I don’t want class to be added. I tried to use "none " for the default value in hopes this would fix the empty space added, but no.

The idea was to create a custom block, set some default styling for it, but then if needed, I can control some extra styling like padding, background color, etc., via an attributes by adding utility classes. In total, I have 5 Class attributes as Select boxes, and if I leave them all empty (in case I want the default look and no extra class), I get something like this in the frontend:

Screenshot 2024-05-08 at 16.43.54

Basically, it adds 5x space because of 5 attributes I have. Of course, I understand the logic that each added class needs space, but when empty (class is not added), then space should also be absent.
So I’m not sure if I am doing something wrong or if this is some bug. Any idea?

1 Like

sounds like a bug… @matjaz correct?

2 Likes