-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Split dropdown button width in .btn-group-vertical broken #10967
Comments
I've been trying to fix these issues by having ISSUES with below proposal
Here's the LESS: /* Button groups in a vertical layout require table layout and
* some border and width touch-ups to show correctly.
*/
.btn-group-vertical > .btn-group {
display: table;
border-collapse: separate;
/* Webkit & IE strangely have pseudo elements of 1px width
* adorned to the .btn-group. This hides them and fixes the
* .btn-group width.
*/
&:before, &:after { display: none; }
/* Children of the .btn-group are treated as table cells.
*/
.btn { display: table-cell; }
/* No border-bottom-radius of the .btn-group is the first
* child of a .btn-group-vertical parent.
*/
&:first-child > .btn { .border-bottom-radius(0); }
/* No border-top-radius of the btn-group is the last
* child of a btn-group-vertical parent.
*/
&:last-child > .btn { .border-top-radius(0); }
/* Fix for only child of .btn-group-vertical rounded borders.
*/
&:first-child:last-child {
> .btn:first-child { .border-left-radius(@border-radius-base); } // apply left border radius to first .btn
> .btn:last-of-type { .border-right-radius(@border-radius-base); } // apply right border radius to last .btn
}
/* No border-left if the .btn is has adjacent sibling .btn.
*/
> .btn + .btn { border-left: none; }
/* Inherit the width of the parent .btn-group-vertical if
* the .btn-group is a single button dropdown.
*/
.btn.dropdown-toggle:first-child { width: inherit; }
/* The .dropdown-toggle button would appear too wide in
* table layout so the width is set to 1px and inherited
* padding, margins and toggle icon take care of the rest.
*/
.btn.dropdown-toggle { width: 1px; }
} The resulting JsFiddle shows the partially fixed |
I've noticed the same issues. |
I have played around extensively with various fixes for the I might try to re-work Thoughts? |
My quick fix although not ideal: <div class="btn-group-vertical">
<button type="button" class="btn btn-default">Button Long Long Long</button>
<div class="btn-group" >
<button type="button" style="width: 100%; padding-right: 8px;" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
Button
<span class="caret pull-right" style="margin-top: 10px;"></span>
</button>
<ul class="dropdown-menu" role="menu" >
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 2</a></li>
<li><a href="#">Item 3</a></li>
</ul>
</div>
<div class="btn-group">
<button type="button" class="btn btn-default" style="width: 100%; margin-right: 28px; padding-right: 20px;">Button</button>
<button type="button" class="btn btn-default dropdown-toggle" style="position: absolute; right: 0; top: 0; z-index: 999;" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 2</a></li>
<li><a href="#">Item 3</a></li>
</ul>
</div>
</div> |
We'll have to tag this as v3.1 since it's technically adding a new feature—we don't currently support nested button groups in vertical button groups. The markup and CSS are super tough as this thread shows, so for the time being I'm going to push it off and prioritize other things. |
@mdo That's fine. The documentation for button group - vertical variation included dropdown buttons (which are a button group) so I was expecting that to be supported. |
Ah, I should clarify @RobJacobs—we don't support the split nested button groups at this time, so this would be a new feature. |
@mdo Cool with me. I actually only got this issue because I was doing up a master component template with all the Bootstrap stuff on one page in all sorts of crazy configurations and constellations. Still think it'd be way easier to structure button groups as lists. Here's my first crack at it JsFiddle. Has some border issues I didn't bother with as I had to move on, but it's a solid base I think. Thoughts? |
Making a personal note that this isn't #11493, and renaming issue to include "Split" in the title. |
I was able to fix this against the 3.0.3 release using the flex box layout:
|
@RobJacobs how is that going to fix the issue on IE8 and IE9 which do not support the flexbox layout model? I'd still prefer a more "generic" solution moving towards 3.1. |
I'm going to punt on this—the extra CSS is just way too much overhead. I also struggle to see a great implemenation of these kind of button groups where you could have regular buttons, split button dropdowns, and button dropdowns. |
Any chance of supporting this sort of nested split buttons in the next release. I have need of this feature. |
+1 for split button dropdown in vertical button group |
Having
.btn-group
buttons (e.g. single button dropdowns and split button dropdowns) inside a.btn-group-vertical
group renders incorrectly in several ways (tested on Win7 IE 10.0.9, FF 24.0 and Chrome 31)..btn-group
widths aren't inherited from widest sibling button within.btn-group-vertical
..btn
..btn
of abtn-group
which is the first child of a.btn-group-vertical
incorrectly has aborder-bottom-left-radius
..btn
of abtn-group
which is the last child of a.btn-group-vertical
incorrectly has aborder-top-right-radius
.See this JsFiddle to visualize said errors.
The text was updated successfully, but these errors were encountered: