8000 fix(b-nav-item-dropdown): `boundary` handling in `<b-navbar>` (closes #5789) by jacobmllr95 · Pull Request #5794 · bootstrap-vue/bootstrap-vue · GitHub
[go: up one dir, main page]

Skip to content

fix(b-nav-item-dropdown): boundary handling in <b-navbar> (closes #5789) #5794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

10000
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/common-props.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"description": "Sets the `placeholder` attribute value on the form control"
},
"disabled": {
"description": "When set to 'true', disables the component's functionality and places it in a disabled state"< 10000 /span>
"description": "When set to `true`, disables the component's functionality and places it in a disabled state"
},
"readonly": {
"description": "Sets the `readonly` attribute on the form control"
Expand Down
4 changes: 0 additions & 4 deletions src/components/nav/nav-item-dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ export const BNavItemDropdown = /*#__PURE__*/ Vue.extend({
toggleId() {
return this.safeId('_BV_toggle_')
},
isNav() {
// Signal to dropdown mixin that we are in a navbar
return true
},
dropdownClasses() {
return [this.directionClass, this.boundaryClass, { show: this.visible }]
},
Expand Down
9 changes: 0 additions & 9 deletions src/components/nav/nav-item-dropdown.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ describe('nav-item-dropdown', () => {
wrapper.destroy()
})

it('should have a flag that we are in a nav', async () => {
const wrapper = mount(BNavItemDropdown)

expect(wrapper.vm).toBeDefined()
expect(wrapper.vm.isNav).toBe(true)

wrapper.destroy()
})

it('should have custom toggle class when "toggle-class" prop set', async () => {
const wrapper = mount(BNavItemDropdown, {
propsData: {
Expand Down
10 changes: 5 additions & 5 deletions src/components/nav/package.json

Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@
"props": [
{
"prop": "text",
"description": "Text to place in the toggle button, or in the split button is split mode"
"description": "Text to place in the toggle element (link)"
},
{
"prop": "html",
"description": "HTML string to place in the toggle button, or in the split button is split mode. Use with caution"
"description": "HTML string to place in the toggle element (link). Use with caution"
},
{
"prop": "dropup",
Expand Down Expand Up @@ -138,16 +138,16 @@
},
{
"prop": "toggleClass",
"description": "CSS class (or classes) to add to the toggle button"
"description": "CSS class (or classes) to add to the toggle element (link)"
},
{
"prop": "noCaret",
"description": "Hide the caret indicator on the toggle button"
"description": "Hide the caret indicator on the toggle element (link)"
},
{
"prop": "boundary",
"version": "2.4.0",
"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"
"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>`"
}
],
"slots": [
Expand Down
3 changes: 1 addition & 2 deletions src/mixins/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ export default {
// Position `static` is needed to allow menu to "breakout" of the `scrollParent`
// boundaries when boundary is anything other than `scrollParent`
// See: https://github.com/twbs/bootstrap/issues/24251#issuecomment-341413786
const { boundary } = this
return boundary !== 'scrollParent' || !boundary ? 'position-static' : ''
return this.boundary !== 'scrollParent' && !this.inNavbar ? 'position-static' : ''
}
},
watch: {
Expand Down
0