-
-
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
Fix multiple dropdowns in input group #28152
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,11 +82,11 @@ | |
} | ||
} | ||
|
||
.btn + .btn, | ||
.btn + .input-group-text, | ||
.input-group-text + .input-group-text, | ||
.input-group-text + .btn { | ||
margin-left: -$input-border-width; | ||
.input-group-text, | ||
.btn { | ||
&:not(:first-child) { | ||
margin-left: -$input-border-width; | ||
} | ||
} | ||
} | ||
|
||
|
@@ -179,6 +179,7 @@ | |
.input-group > .input-group-append:not(:last-child) > .btn, | ||
.input-group > .input-group-append:not(:last-child) > .input-group-text, | ||
.input-group > .input-group-append:last-child > .btn:not(:last-child):not(.dropdown-toggle), | ||
.input-group > .input-group-append:last-child > .dropdown-toggle:nth-last-child(n + 3), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This feels like it'd break very easily—folks introduce custom markup in all the places we wouldn't expect. 😬 |
||
.input-group > .input-group-append:last-child > .input-group-text:not(:last-child) { | ||
@include border-right-radius(0); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -211,17 +211,32 @@ Multiple add-ons are supported and can be mixed with checkbox and radio input ve | |
<input type="text" class="form-control" aria-label="Text input with dropdown button"> | ||
</div> | ||
|
||
<div class="input-group mb-3"> | ||
<input type="text" class="form-control" aria-label="Text input with dropdown button"> | ||
<div class="input-group-append"> | ||
<button class="btn btn-outline-secondary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</button> | ||
<div class="dropdown-menu dropdown-menu-right"> | ||
<a class="dropdown-item" href="#">Action</a> | ||
<a class="dropdown-item" href="#">Another action</a> | ||
<a class="dropdown-item" href="#">Something else here</a> | ||
<div role="separator" class="dropdown-divider"></div> | ||
<a class="dropdown-item" href="#">Separated link</a> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="input-group"> | ||
<input type="text" class="form-control" aria-label="Text input with dropdown button"> | ||
<div class="input-group-append"> | ||
<button class="btn btn-outline-secondary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</button> | ||
<div class="dropdown-menu"> | ||
<div class="dropdown-menu dropdown-menu-right"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added this because it just looks nicer if the dropdowns are aligned with the end of the button |
||
<a class="dropdown-item" href="#">Action</a> | ||
<a class="dropdown-item" href="#">Another action</a> | ||
<a class="dropdown-item" href="#">Something else here</a> | ||
<div role="separator" class="dropdown-divider"></div> | ||
<a class="dropdown-item" href="#">Separated link</a> | ||
</div> | ||
<button class="btn btn-outline-secondary" type="button">Button</button> | ||
</div> | ||
</div> | ||
{% endcapture %} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could also have added
.dropdown-menu
here, but figured out this would save us a lot of selectors.