Forum Academy Marketplace Showcase Pricing Features

Collapse width of a group when hidden

Is it possible to collapse the width of a group that is hidden ?
I have two groups (left and right) that are in the same row (a group as well), and that are both left-aligned.
When hiding the left group, I would expect the right one to take its position since they are left-aligned, and clicking on “explain box margin” displays a small margin for the group at the right.
However, this si not what happens: it just leaves an empty space and the group at the right stays at the same position…

Here is an example with the responsive settings (same for both groups):

And the explanation fo box margin. Note that the left margin of the right group is supposed to be 14px and fixed:

And here is what happens when the left group is hidden:

We clearly see that the left margin is not 14px while it was supposed to be fixed… I would expect to have the right group go left, as the arrow shows

4 Likes

Hi @florent.bocquelet :slight_smile: Do you have a hiding rule set up on the purple group? If so, it should collapse in width. However, if it becomes hidden with a conditional statement, I don’t believe it will collapse in width.

3 Likes

Yes, it is just a conditional statement.
I would still expect it to collapse though…

It would be nice to have this feature

Were you able to find a solution? I need this fix too.

1 Like

Nop, nothing for now.
I changed the design of my page to avoid this issue

I found a solution:

https://forum.bubble.io/t/how-to-hide-whitespace-left-by-hidden-images-in-group/

Yes but this only work through using repeating groups.
I think this is more a trick than a solution, but good if this works for you ! :slight_smile:

2 Likes

Hi, want to know how to resolve this issue also.

I also need a way to accomplish this. Need a way to shift groups left - or right when other groups to the left or right are hidden/not visible.

One more from me, difficult to work around this for a responsive page design. Hidden groups leave empty space in the grid. Anyone found a solution?

1 Like

I need this as well :slight_smile:

My use case is left box has vertical repeating group and when user selects one row I want to be able to shrink left box to make room for right box for row details

Bubble @team ? any hint ?

Hi guys,
You could make your red group as wide as your page under your purple group. Set the left margin as solid and equal to the purple group width.
With a condition when purple group is hidden : the left margin of the red group is set to 0.
The issue with this workaround is that it’s not responsive…

Do you have a hiding rule set up on the purple group? If so, it should collapse in width.

I can’t reproduce what you describe, how to do it ?

Just opening this thread again as I also have this issue. Anyone found an elegant way to do this?

My use case: on a social profile page we want to show icons for each social platform that a user has added. It currently looks really odd when someone has filled out the first and last few options, because there’s a massive gap in the middle.

Example:

2 Likes

If you have groups of the same type displaying (i.e. photos or texts) you’re best bet is a repeating group in horizontal layout.

If you have groups of different types side-by-side (i.e. you have different types of users logging on that for some you may show one group of type A and for other type B and for others both groups (like Patients see prescriptions, Nurses see Doctor’s schedule, Doctors see both side-by-side), then you have no option but to duplicate the entire group:
-Wrap your two groups in your example in a master grouping container.
-Set that container to “collapse height when hidden” and to not be visible on page load
-Duplicate the entire master group container and place it below the first master group with 0px vertical spacing
-Delete the possibly-hidden group entirely out of the second master and expand your still-showable group
-Set conditionals on both master groups to properly display respectively
-Repeat this for all permutations

Your page might get quite long in the editor, but on display the collapsing hidden groups will render just fine.

Has anyone found a solution to this?

1 Like
  • Set up a state called ‘Layout’ and put it as a number.

  • Create a field in the User data type called ‘Layout’ as text (or checkbox/number)

  • Create two layouts, using 2 groups. 1 group would have the half screen layout with the side bar like your image called 'Side Bar View. Then duplicate that group and move it all the way to the left and call the second group ‘Full Screen View’.

  • Add an icon like an arrow or a minimise icon on your side bar.

  • Have a workflow that says ‘When this icon is clicked, change Layout state to 1’ and 'Make a change to Current User’s Layout field to ‘full screen’

  • Add an icon like a right arrow or maximise icon at the top left or you could have it in a settings page etc

  • Have a workflow that says ‘When this maximise icon is clicked, change state to 0’ and 'Make a change to Current User’s Layout field to ‘side bar enabled’

  • Have a workflow that says ‘When page loads, show Side Screen View group’ and ‘When Page loads, show Full Screen View group’ and in the ‘Only When’ area put 'Only when Current User’s Layout is ‘side bar enabled’. for the Side Screen View group. For the Full Screen View group put 'Only when Current User’s Layout is ‘full screen’.

*Note: When your user is creating an account ensure that you do ‘Create a thing’ and Field name, address, date of birth yada yada but make sure you have the field = Layout to either ‘side bar enabled’ or ‘full screen’ otherwise they won’t see either.

I created my side bar as a separate floating group and toggled that on when the side bar enabled was on, so that my side bar could scroll no matter how long the actual page was, otherwise you’d scroll and your side bar would slowly disappear.

That’s how I’ve done it, hope that helps! :grinning:

1 Like

I haven’t done extensive testing on this method, but I think it is providing you with what you are looking for. For a quick look, here are the links:

Editor: https://bubble.io/page?type=page&name=text_menu_page&id=bsi-forum-app&tab=tabs-1

Demo: https://bsi-forum-app.bubbleapps.io/version-test/text_menu_page?debug_mode=true

If I was to do this, I would take one group and put it on the left side in the width that I would want the menu to be. Then I would add a floating group on top of it to build the menu in. Create animations on the floating group to slide it out and slide it in depending upon some action.

Next, add a drag/drop group to the right of the menu group and increase it to the width you to fill the page. This becomes the content group. Add an inner group to this one and build all your content in this one.

For the workflow actions, animate the menu group close and then move the drag/drop group using coordinates. When closing the menu, move the group by the x-coordinate by half the width of the menu (if the menu is 300px wide, move the drag/drop group -150 in the x-coordinate).

In the workflow for the showing of the menu, animate the showing of the floating group and then move the drag/drop group back to 0 in the x-coordinate. And with that, you have the sliding content when you collapse the menu.

As a note on this, you will need to do some work on the responsive side. When viewing on a tablet/mobile device, use the responsive tab to collapse the group under the floating group. Then use the current page width to prevent the drag/drop group from being moved at all.

1 Like