WAIT: Show/Hide interaction They ruin the layout

Browser: Chrome 110
OS: macOS / Windows / Linux / etc.
URL: Link to a page that illustrates this issue
Video: Short screen recording that illustrates this issue (free tool: jam.dev)

Hello bricks team,

When we use the show/hide element interaction, bricks hides the elements by adding inline style. But the problem is that the show element action adds Display: block to the element. This causes problems if the target layout is flex.

Wouldn’t it be better if the actions to show/hide elements in interactions worked using add/remove attributes? This would ensure that flex targets never had any problems.

Please see here. This is a comparison between showing/hiding elements using inline styles and attributes.

On this website, if you double-click the “show element” button in the example below, the flex will break. But in the example above, the element is hidden by adding the brxe-hide attribute and never affects the flex.

Best regards
Victor

Hi @Victor1999,

this is how it has been working since the feature was introduced, as far as I know, so this is not a bug - I move it to the Feature Requests / Improvements category.
As for now, you can add/remove the data attribute that you choose and create your own logic, like you did in the first case.

Best regards,
Matej

1 Like