I had this problem. The show element interaction only does display block. The solution was to do set and remove attribute instead. And then I have a css class with display:none that gets added or removed from the element based on the click. And then have the display:grid on the element itself.
In my case it means it disappears from the dom. Which would be bad for SEO since it contains homepage links to the pages. So I need them to ‘be there’.
So in my case tabs will be better.
Still cool to now that’s how to solve it for now.
Thanks for highlighting this.
You are right, currently, the Interactions hide/show element is using display:block and display:none on the target element.
I have added this into the improvement suggestion which we will follow the original element display value when performing hide and show.
As a workaround, I will suggest you to create a yourHide CSS class in Bricks > Settings > Custom Code > Custom CSS
Example:
.yourHide {
display: none !important;
}
Then use Interaction Toggle Attribute / Set Arttibute / Remove Attribute to control the class on your target element.
Hi, there is an issue with this, how would you allow an element to start with display:none?
There would be no start display value given besides display none?
Visibility:hidden; doesn’t remove the actual element but just hides it. Margin etc. will still be added.
How would one tackle this issue?
Small edit:
It would be possible to add an interaction to each element i want to be hidden from the start that hides the element once content has been loaded, with a delay of 0s targeting itself.
However, this isn’t optimal as it requires a lot of extra work.