# Element height when hidden

**URL:** <https://forum.bubble.io/t/element-height-when-hidden/45170>\
**Category:** Responsiveness\
**Created:** [December 21, 2018, 9:59pm UTC](https://forum.bubble.io/t/element-height-when-hidden/45170 "2018-12-21T21:59:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nocodeventure](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nocodeventure/32/247164_2.png) [@nocodeventure](https://forum.bubble.io/u/nocodeventure)\
**Post date:** [December 21, 2018, 9:59pm UTC](https://forum.bubble.io/t/element-height-when-hidden/45170/1 "2018-12-21T21:59:53Z")

</div>

Update to my question as the previous one was not so clear.

I created a menu for my application. This menu is the main group. Inside the menu I have subcategory groups and inside the subcategory group I have the text element.

When I hide the subcategory group I also collapse this element’s height. The problem for me is that the main group is also affected by the height.

---

<div class="post-metadata">

**Author:** ![fayewatson](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/fayewatson/32/2686_2.png) [@fayewatson](https://forum.bubble.io/u/fayewatson)\
**Post date:** [December 21, 2018, 10:37pm UTC](https://forum.bubble.io/t/element-height-when-hidden/45170/2 "2018-12-21T22:37:27Z")

</div>

Hi @nocodeventure 🙂 Yes, a text element’s height will collapse when hidden. Here is more info:

> [@Breaking change - Invisible text elements now collapse](http://forum.bubble.io/t/breaking-change-invisible-text-elements-now-collapse/38334):
>
> Hi everyone, We’re rolling out a new breaking change regarding the text element. Historically, a text element made invisible has maintained its height, meaning that everything beneath it remains in place. Going forward, checking the box “Shrink the element height if the text gets shorter” in the property editor will cause it will work the way a collapsable group does–its height will go to zero when it becomes invisible. This seems to us to be a more logical default behavior. As with all breaki…

---

<div class="post-metadata">

**Author:** ![nocodeventure](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nocodeventure/32/247164_2.png) [@nocodeventure](https://forum.bubble.io/u/nocodeventure)\
**Post date:** [December 22, 2018, 7:42am UTC](https://forum.bubble.io/t/element-height-when-hidden/45170/3 "2018-12-22T07:42:08Z")

</div>

I made a mistake when I said im hiding the text element. I am hiding the subcategory group inside the main group.

For example I have the text element inside a subcategory group and the strange thing is that also the menu group height changes when the subcategory element is hidden.

The issue is the main group being affected by the collapse.

---

<div class="post-metadata">

**Author:** ![fayewatson](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/fayewatson/32/2686_2.png) [@fayewatson](https://forum.bubble.io/u/fayewatson)\
**Post date:** [December 22, 2018, 9:01am UTC](https://forum.bubble.io/t/element-height-when-hidden/45170/4 "2018-12-22T09:01:42Z")

</div>

@nocodeventure Ohh, got it! 🙂

One workaround is to place the submenu groups in a group, and place a shape element at the bottom of the main group (inside the main group, but outside of the submenu group):

Main Group:

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/c/9/c9cef5a0d0d38e39fa0f85bfe9caaebf5d8ec362.png)

Inner Submenu Group:

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/9/0/902aa1527c9539dc10bb2cd38841a839464c7359.png)

Shape element:

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/b/7/b755d6ca8dcc0f69f0b49dd994a3b6d79304587f.png)

Here I made the shape yellow and large but this could just be 1px by 1px and transparent on the left-side of the submenu groups. This way it won’t be noticeable to the User, but Bubble will maintain the shape element’s top margin, preventing the main group from changing in height as the inside submenu groups collapse in height.

Preview:

> **[Bubble - Visual Programming](https://faye-demo-app.bubbleapps.io/version-test/height-collapse-submenu)**
>
> Build stuff without code and launch a startup without a tech-cofounder! Bubble is a visual programing language. Instead of typing code, use a visual editor to build applications.

Editor:

> **[Bubble Editor - faye-demo-app](https://bubble.io/page?type=page&name=height-collapse-submenu&id=faye-demo-app&tab=tabs-1)**
>
> Build stuff without code and launch a startup without a tech-cofounder! Bubble is a visual programing language. Instead of typing code, use a visual editor to build applications.

That should work! 🙂

---

<div class="post-metadata">

**Author:** ![nocodeventure](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nocodeventure/32/247164_2.png) [@nocodeventure](https://forum.bubble.io/u/nocodeventure)\
**Post date:** [December 22, 2018, 6:04pm UTC](https://forum.bubble.io/t/element-height-when-hidden/45170/5 "2018-12-22T18:04:53Z")

</div>

I appreciate the solution but this seems like a bug and the solution is not working for me the main group height is still affected. Why is the main group height being affected…

---

<div class="post-metadata">

**Author:** ![fayewatson](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/fayewatson/32/2686_2.png) [@fayewatson](https://forum.bubble.io/u/fayewatson)\
**Post date:** [December 22, 2018, 6:24pm UTC](https://forum.bubble.io/t/element-height-when-hidden/45170/6 "2018-12-22T18:24:23Z")

</div>

@nocodeventure I believe this is intended behavior as this is commonly used for single page apps that have many vertically-stacked groups, which are shown conditionally and collapse in height when hidden. In those cases, collapsing the main group’s height would be preferred so there isn’t a ton of extra scrolling/whitespace. If you’d like to share a link to your app editor or a screenshot of your setup I can definitely take a look!

---

<div class="post-metadata">

**Author:** ![nocodeventure](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nocodeventure/32/247164_2.png) [@nocodeventure](https://forum.bubble.io/u/nocodeventure)\
**Post date:** [December 22, 2018, 9:10pm UTC](https://forum.bubble.io/t/element-height-when-hidden/45170/7 "2018-12-22T21:10:30Z")

</div>

sent pm
