Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collapse overflow fix #2423

Closed
wants to merge 2 commits into from
Closed

Collapse overflow fix #2423

wants to merge 2 commits into from

Conversation

pelme
Copy link

@pelme pelme commented Mar 6, 2012

Currently, .collapse.in specifies overflow: hidden, probably to make the animations behave correctly.

This causes problems when using drop-downs or other dynamic content that overflows the collapse area.

This can be seen in this jsfiddle:
http://jsfiddle.net/rdXfZ/1/

The commit simply uses overflow: visible for .collapse.in, and patches the show/hide in collapse() to properly set overflow.

@pelme
Copy link
Author

pelme commented Mar 8, 2012

Thanks for pointing that out! The issue with overflow: hidden in .tab-content is fixed in 2.0.2-wip. See #2079 for more details.

@mdo
Copy link
Member

mdo commented Mar 12, 2012

Manually handled this in 2.0.2-wip by making just the CSS change. Thanks!

@mdo mdo closed this Mar 12, 2012
@pelme
Copy link
Author

pelme commented Mar 12, 2012

I should have probably have clarified this above: Without the javascript changes, the overflow problem is solved, but the collapsible animations does not behave correctly.

The latest animations in the docs of a 2.0.2-wip build is broken. The content is shown before the width/height is animated.

@mynameistechno
Copy link

pelme is correct, it's still jacked up

@mynameistechno
Copy link

Temporary workaround:

.collapse.in { overflow: hidden; }

When initializing collapse, pass in the following in the options hash:

    {
      hide: function() {
        $( this ).css( 'overflow', 'hidden' );
      },
      shown: function() {
        $( this ).css( 'overflow', 'visible' );      
      }    
    }

fran6co added a commit to fran6co/bootstrap that referenced this pull request May 7, 2012
@mirasrael
Copy link

After some research and experiments I found solution with following CSS selector:

.collapse.in[style="height: auto;"] {
overflow: visible;
}

It really looks like a hack, but amazingly works.
If you just apply selector without attribute matching it will have problems with overlapping content of collapsible panel while expanding. But with this selector it applies new overflow value only after animation will be completed.

@jbranc
Copy link

jbranc commented Feb 15, 2013

thanks@mirasrael!

@jbranc
Copy link

jbranc commented Feb 15, 2013

@mirasrael also, fwiw, i had to ensure the start state was set properly. without the height:auto style set initially, then it won't work. This did the trick.
$('.collapse.in').css('height','auto');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants