Site logo

[Support request] GenerateBlocks bug when duplicating elements?

Home Forums Support [Support request] GenerateBlocks bug when duplicating elements?

Home Forums Support GenerateBlocks bug when duplicating elements?

  • This topic has 6 replies, 2 voices, and was last updated 3 years ago by David.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #2600473
    John

    Hi team,

    I’m encountering some issues with GB (Pro), I think it started happening after the latest major update, but I’m not entirely sure. I believe it’s a bug.

    When I duplicate an GB element (e.g. a container), or when I use a Local Pattern, it seems that the duplicated/copied elements have the same CSS class and therefore are styled in the same way as the original element (i.e. the element that was duplicated).

    The expected behavior, as far as I’m concerned, should be that the duplicated element has the same styling and is identical to the original element, but that it can be styled independently after that. In other words, it has a different css class and can be styled separately. As it currently stands, duplicated elements seem to behave more like a reusable block.

    Have you encountered that issue? Is there a way to avoid it?

    Thank you

    #2600821
    David
    Staff
    Customer Support

    Hi there,

    To fix that, you can select a Block and from the 3 dot menu choose Duplicate, and then delete the original.
    Duplicating blocks on the same post ( page, element etc. ) will update its unique CSS classes.

    The issue is that the function to update classes when a block is copied only fires if its a copy and paste in the same editor instance, ie. in the same post. In all other instances it doesn’t know this and treats it as an exact copy. And currently there is no automatic way of fixing that, but we’re still looking into it .

    #2600918
    John

    David, thank you that explains it. Then I realize my specific process may make the situation worse, and maybe it’s worth explaining my use case.

    The way I use Local Patterns is by first creating a design in my real page, then copy it into a Local Pattern, then reuse that Local Pattern elsewhere. So if I understand correctly, I may be duplicating the same classes everywhere?

    But if that’s true, then it makes me wonder how I should use Local Patterns. Aren’t they always going to be copying the classes from the pattern, thus limiting the customization of each implementation of the local pattern?

    #2600920
    John

    Hmm it doesn’t seem to work. I was having problems with a Grid, unable to modify the width of the Post Template container.

    I just duplicated the Grid within the same post in order to, hopefully, create unique css classes for all of its elements.

    However, I’m still unable to modify its width. And playing with the flex settings of one instance is modifying the other one equally.. looking at the inspector, they do indeed still have the same class… how can I force the creation of a unique set of classes?

    #2600925
    John

    I just duplicated a gb-headline element inside the post template, and I confirm it has the same class identifier as well… it’s all in the same editor instance so according to what you said, it should give the duplicated element a new class id. So is that a bug?

    #2600928
    John

    However if I create a gb-headline from scratch at the root of the ‘element tree’, then duplicate it, it correctly takes on a different class id. Very confusing

    #2601094
    David
    Staff
    Customer Support

    FYI – The Pattern won’t be an issue as that will ( should ) generate its own CSS Classes on import to a post.

    Is it possible to see the issue on the site ?

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.