@@ -4,6 +4,7 @@ import { BvEvent } from '../utils/bv-event.class'
4
4
import { attemptFocus , closest , contains , isVisible , requestAF , selectAll } from '../utils/dom'
5
5
import { stopEvent } from '../utils/events'
6
6
import { isNull } from '../utils/inspect'
7
+ import { mergeDeep } from '../utils/object'
7
8
import { HTMLElement } from '../utils/safe-types'
8
9
import { warn } from '../utils/warn'
9
10
import clickOutMixin from './click-out'
@@ -68,17 +69,17 @@ export const commonProps = {
68
69
default : false
69
70
} ,
70
71
offset : {
71
- // Number of pixels to offset menu, or a CSS unit value (i.e. 1px, 1rem, etc)
72
+ // Number of pixels to offset menu, or a CSS unit value (i.e. ` 1px`, ` 1rem` , etc. )
72
73
type : [ Number , String ] ,
73
74
default : 0
74
75
} ,
75
76
noFlip : {
76
- // Disable auto-flipping of menu from bottom<=>top
77
+ // Disable auto-flipping of menu from bottom <=> top
77
78
type : Boolean ,
78
79
default : false
79
80
} ,
80
81
popperOpts : {
81
- // type: Object,
82
+ type : Object ,
82
83
default : ( ) => { }
83
84
} ,
84
85
boundary : {
@@ -128,6 +129,13 @@ export default {
128
129
return 'dropleft'
129
130
}
130
131
return ''
132
+ } ,
133
+ boundaryClass ( ) {
134
+ // Position `static` is needed to allow menu to "breakout" of the `scrollParent`
135
+ // boundaries when boundary is anything other than `scrollParent`
136
+ // See: https://github.com/twbs/bootstrap/issues/24251#issuecomment-341413786
137
+ const { boundary } = this
138
+ return boundary !== 'scrollParent' || ! boundary ? 'position-static' : ''
131
139
}
132
140
} ,
133
141
watch : {
@@ -267,10 +275,11 @@ export default {
267
275
flip : { enabled : ! this . noFlip }
268
276
}
269
277
}
270
- if ( this . boundary ) {
271
- popperConfig . modifiers . preventOverflow = { boundariesElement : this . boundary }
278
+ const boundariesElement = this . boundary
279
+ if ( boundariesElement ) {
280
+ popperConfig . modifiers . preventOverflow = { boundariesElement }
272
281
}
273
- return { ... popperConfig , ... ( this . popperOpts || { } ) }
282
+ return mergeDeep ( popperConfig , this . popperOpts || { } )
274
283
} ,
275
284
// Turn listeners on/off while open
276
285
whileOpenListen ( isOpen ) {
0 commit comments