Bricksforge does not remove a class on click

Hi all, Bricksforge does not remove the hide-readmore class when you click the button (#brxe-uxlyrn). Tried a lot of settings. What am I doing wrong?

Does this ID really exists in the frontend? With the Bricks Setting „Add Element ID and Class as needed“ it’s possible that bricks does not add this ID to the element. This could be a reason why the event is never firing. Please re-check that :blush:

1 Like

The ID does exist, but when you click the class is not deleted :frowning:

But the ID you’ve entered in the Panel is another than the ID from your second screenshot :wink: That’s the reason why the selector cannot be found. You need „Query Selector“ instead of „Triggered Element“ as target option. And if there are more than one hide-readmore classes in the DOM, you should use „Query Selector All“ or input also the related ID of the element you want to remove the class.

1 Like

Daniele, thank you, it worked :slight_smile:
But now how to make the “hide-readmore” class return when you click again? I didn’t find “secondary click” or something like that in events.
I was able to implement adding a “hide-readmore” class with “double click”, but I think this would be a bit confusing for site users

:slight_smile: On the first click, you additionally could add a class to the element, e.g. “open”. Then, you can fire the action with a condition and ask for this class. If the class exists on the element, do this. Otherwise, do that :slight_smile:

You can setup conditions clicking this icon:

Xnapper-2023-06-27-00.40.45

1 Like

I have a similar problem. I have the correct ID because hide and show works. I have added two new classes logo1 and logo2. Unfortunately it doesn’t work add class and remove class.

Could you describe some steps to reproduce this?

1 Like

I uploaded a video of this case on discord. Can I record more? What information will be important to you?

The reason is that you are using a global class that is not yet loaded initially. For performance reasons, Bricks only loads styles that are really needed on the page. Therefore, the style definitions are not present when you add the class later.