Skip to content

Commit 73383bf

Browse files
authored
fix(b-nav-item-dropdown): boundary handling in <b-navbar> (closes #5789) (#5794)
* fix(b-nav-item-dropdown): `boundary` handling in `<b-navbar>` * Update nav-item-dropdown.spec.js
1 parent 31eeb0a commit 73383bf

File tree

5 files changed

+7
-21
lines changed

5 files changed

+7
-21
lines changed

docs/common-props.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
"description": "Sets the `placeholder` attribute value on the form control"
127127
},
128128
"disabled": {
129-
"description": "When set to 'true', disables the component's functionality and places it in a disabled state"
129+
"description": "When set to `true`, disables the component's functionality and places it in a disabled state"
130130
},
131131
"readonly": {
132132
"description": "Sets the `readonly` attribute on the form control"

src/components/nav/nav-item-dropdown.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ export const BNavItemDropdown = /*#__PURE__*/ Vue.extend({
2929
toggleId() {
3030
return this.safeId('_BV_toggle_')
3131
},
32-
isNav() {
33-
// Signal to dropdown mixin that we are in a navbar
34-
return true
35-
},
3632
dropdownClasses() {
3733
return [this.directionClass, this.boundaryClass, { show: this.visible }]
3834
},

src/components/nav/nav-item-dropdown.spec.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,6 @@ describe('nav-item-dropdown', () => {
3434
wrapper.destroy()
3535
})
3636

37-
it('should have a flag that we are in a nav', async () => {
38-
const wrapper = mount(BNavItemDropdown)
39-
40-
expect(wrapper.vm).toBeDefined()
41-
expect(wrapper.vm.isNav).toBe(true)
42-
43-
wrapper.destroy()
44-
})
45-
4637
it('should have custom toggle class when "toggle-class" prop set', async () => {
4738
const wrapper = mount(BNavItemDropdown, {
4839
propsData: {

src/components/nav/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@
9898
"props": [
9999
{
100100
"prop": "text",
101-
"description": "Text to place in the toggle button, or in the split button is split mode"
101+
"description": "Text to place in the toggle element (link)"
102102
},
103103
{
104104
"prop": "html",
105-
"description": "HTML string to place in the toggle button, or in the split button is split mode. Use with caution"
105+
"description": "HTML string to place in the toggle element (link). Use with caution"
106106
},
107107
{
108108
"prop": "dropup",
@@ -138,16 +138,16 @@
138138
},
139139
{
140140
"prop": "toggleClass",
141-
"description": "CSS class (or classes) to add to the toggle button"
141+
"description": "CSS class (or classes) to add to the toggle element (link)"
142142
},
143143
{
144144
"prop": "noCaret",
145-
"description": "Hide the caret indicator on the toggle button"
145+
"description": "Hide the caret indicator on the toggle element (link)"
146146
},
147147
{
148148
"prop": "boundary",
149149
"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"
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>`"
151151
}
152152
],
153153
"slots": [

src/mixins/dropdown.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,7 @@ export default {
127127
// Position `static` is needed to allow menu to "breakout" of the `scrollParent`
128128
// boundaries when boundary is anything other than `scrollParent`
129129
// See: https://github.com/twbs/bootstrap/issues/24251#issuecomment-341413786
130-
const { boundary } = this
131-
return boundary !== 'scrollParent' || !boundary ? 'position-static' : ''
130+
return this.boundary !== 'scrollParent' && !this.inNavbar ? 'position-static' : ''
132131
}
133132
},
134133
watch: {

0 commit comments

Comments
 (0)