Skip to content

Commit 3a50ad8

Browse files
feat(b-nav-item-dropdown): add boundary prop, applicable when not in b-navbar (closes #4684) (#4691)
* feat(b-nav-item-dropdown): add boundary prop (used when not in b-navbar) * Update dropdown.js * Update dropdown.js * Update package.json Co-authored-by: Jacob Müller <jacob.mueller.elz@gmail.com>
1 parent dba2beb commit 3a50ad8

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

src/components/dropdown/dropdown.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import Vue from '../../utils/vue'
22
import { arrayIncludes } from '../../utils/array'
33
import { stripTags } from '../../utils/html'
44
import { getComponentConfig } from '../../utils/config'
5-
import { HTMLElement } from '../../utils/safe-types'
65
import idMixin from '../../mixins/id'
76
import dropdownMixin from '../../mixins/dropdown'
87
import normalizeSlotMixin from '../../mixins/normalize-slot'
@@ -72,12 +71,6 @@ export const props = {
7271
role: {
7372
type: String,
7473
default: 'menu'
75-
},
76-
boundary: {
77-
// String: `scrollParent`, `window` or `viewport`
78-
// HTMLElement: HTML Element reference
79-
type: [String, HTMLElement],
80-
default: 'scrollParent'
8174
}
8275
}
8376

src/components/nav/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@
143143
{
144144
"prop": "noCaret",
145145
"description": "Hide the caret indicator on the toggle button"
146+
},
147+
{
148+
"prop": "boundary",
149+
"version": "2.4.0",
150+
"description": "The boundary constraint of the menu: 'scrollParent', 'window', 'viewport', or a reference to an HTMLElement. Has no effect when dropdown is inside a b-navbar"
146151
}
147152
],
148153
"slots": [

src/mixins/dropdown.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { BvEvent } from '../utils/bv-event.class'
44
import { closest, contains, isVisible, requestAF, selectAll } from '../utils/dom'
55
import { hasTouchSupport } from '../utils/env'
66
import { isNull } from '../utils/inspect'
7+
import { HTMLElement } from '../utils/safe-types'
78
import { warn } from '../utils/warn'
89
import clickOutMixin from './click-out'
910
import focusInMixin from './focus-in'
@@ -108,6 +109,12 @@ export default {
108109
popperOpts: {
109110
// type: Object,
110111
default: () => {}
112+
},
113+
boundary: {
114+
// String: `scrollParent`, `window` or `viewport`
115+
// HTMLElement: HTML Element reference
116+
type: [String, HTMLElement],
117+
default: 'scrollParent'
111118
}
112119
},
113120
data() {

0 commit comments

Comments
 (0)