@@ -4,6 +4,7 @@ import { BvEvent } from '../utils/bv-event.class'
44import { attemptFocus , closest , contains , isVisible , requestAF , selectAll } from '../utils/dom'
55import { stopEvent } from '../utils/events'
66import { isNull } from '../utils/inspect'
7+ import { mergeDeep } from '../utils/object'
78import { HTMLElement } from '../utils/safe-types'
89import { warn } from '../utils/warn'
910import clickOutMixin from './click-out'
@@ -68,17 +69,17 @@ export const commonProps = {
6869 default : false
6970 } ,
7071 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. )
7273 type : [ Number , String ] ,
7374 default : 0
7475 } ,
7576 noFlip : {
76- // Disable auto-flipping of menu from bottom<=>top
77+ // Disable auto-flipping of menu from bottom <=> top
7778 type : Boolean ,
7879 default : false
7980 } ,
8081 popperOpts : {
81- // type: Object,
82+ type : Object ,
8283 default : ( ) => { }
8384 } ,
8485 boundary : {
@@ -128,6 +129,13 @@ export default {
128129 return 'dropleft'
129130 }
130131 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' : ''
131139 }
132140 } ,
133141 watch : {
@@ -267,10 +275,11 @@ export default {
267275 flip : { enabled : ! this . noFlip }
268276 }
269277 }
270- if ( this . boundary ) {
271- popperConfig . modifiers . preventOverflow = { boundariesElement : this . boundary }
278+ const boundariesElement = this . boundary
279+ if ( boundariesElement ) {
280+ popperConfig . modifiers . preventOverflow = { boundariesElement }
272281 }
273- return { ... popperConfig , ... ( this . popperOpts || { } ) }
282+ return mergeDeep ( popperConfig , this . popperOpts || { } )
274283 } ,
275284 // Turn listeners on/off while open
276285 whileOpenListen ( isOpen ) {
0 commit comments