@@ -24,6 +24,10 @@ export const props = {
2424 type : String ,
2525 default : ( ) => getComponentConfig ( NAME , 'variant' )
2626 } ,
27+ block : {
28+ type : Boolean ,
29+ default : false
30+ } ,
2731 menuClass : {
2832 type : [ String , Array ] ,
2933 default : null
@@ -84,9 +88,16 @@ export const BDropdown = /*#__PURE__*/ Vue.extend({
8488 this . directionClass ,
8589 {
8690 show : this . visible ,
87- // Position `static` is needed to allow menu to "breakout" of the scrollParent boundaries
88- // when boundary is anything other than `scrollParent`
89- // See https://github.com/twbs/bootstrap/issues/24251#issuecomment-341413786
91+ // The 'btn-group' class is required in `split` mode for button alignment
92+ // It needs also to be applied when `block` is disabled to allow multiple
93+ // dropdowns to be aligned one line
94+ 'btn-group' : this . split || ! this . block ,
95+ // When `block` is enabled and we are in `split` mode the 'd-flex' class
96+ // needs to be applied to allow the buttons to stretch to full width
97+ 'd-flex' : this . block && this . split ,
98+ // Position `static` is needed to allow menu to "breakout" of the `scrollParent`
99+ // boundaries when boundary is anything other than `scrollParent`
100+ // See: https://github.com/twbs/bootstrap/issues/24251#issuecomment-341413786
90101 'position-static' : this . boundary !== 'scrollParent' || ! this . boundary
91102 }
92103 ]
@@ -115,9 +126,10 @@ export const BDropdown = /*#__PURE__*/ Vue.extend({
115126 const buttonContent = this . normalizeSlot ( 'button-content' ) || this . html || stripTags ( this . text )
116127 if ( this . split ) {
117128 const btnProps = {
118- disabled : this . disabled ,
119129 variant : this . splitVariant || this . variant ,
120- size : this . size
130+ size : this . size ,
131+ block : this . block ,
132+ disabled : this . disabled
121133 }
122134 // We add these as needed due to router-link issues with defined property with undefined/null values
123135 if ( this . splitTo ) {
@@ -149,10 +161,11 @@ export const BDropdown = /*#__PURE__*/ Vue.extend({
149161 staticClass : 'dropdown-toggle' ,
150162 class : this . toggleClasses ,
151163 props : {
164+ tag : this . toggleTag ,
152165 variant : this . variant ,
153166 size : this . size ,
154- disabled : this . disabled ,
155- tag : this . toggleTag
167+ block : this . block && ! this . split ,
168+ disabled : this . disabled
156169 } ,
157170 attrs : {
158171 id : this . safeId ( '_BV_toggle_' ) ,
@@ -186,7 +199,7 @@ export const BDropdown = /*#__PURE__*/ Vue.extend({
186199 return h (
187200 'div' ,
188201 {
189- staticClass : 'dropdown btn-group b-dropdown' ,
202+ staticClass : 'dropdown b-dropdown' ,
190203 class : this . dropdownClasses ,
191204 attrs : { id : this . safeId ( ) }
192205 } ,
0 commit comments