Skip to content

Commit

Permalink
feat(b-nav-item-dropdown): add boundary prop, applicable when not i…
Browse files Browse the repository at this point in the history
…n `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>
  • Loading branch information
tmorehouse and jacobmllr95 committed Jan 29, 2020
1 parent dba2beb commit 3a50ad8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/components/dropdown/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import Vue from '../../utils/vue'
import { arrayIncludes } from '../../utils/array'
import { stripTags } from '../../utils/html'
import { getComponentConfig } from '../../utils/config'
import { HTMLElement } from '../../utils/safe-types'
import idMixin from '../../mixins/id'
import dropdownMixin from '../../mixins/dropdown'
import normalizeSlotMixin from '../../mixins/normalize-slot'
Expand Down Expand Up @@ -72,12 +71,6 @@ export const props = {
role: {
type: String,
default: 'menu'
},
boundary: {
// String: `scrollParent`, `window` or `viewport`
// HTMLElement: HTML Element reference
type: [String, HTMLElement],
default: 'scrollParent'
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/components/nav/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@
{
"prop": "noCaret",
"description": "Hide the caret indicator on the toggle button"
},
{
"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"
}
],
"slots": [
Expand Down
7 changes: 7 additions & 0 deletions src/mixins/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { BvEvent } from '../utils/bv-event.class'
import { closest, contains, isVisible, requestAF, selectAll } from '../utils/dom'
import { hasTouchSupport } from '../utils/env'
import { isNull } from '../utils/inspect'
import { HTMLElement } from '../utils/safe-types'
import { warn } from '../utils/warn'
import clickOutMixin from './click-out'
import focusInMixin from './focus-in'
Expand Down Expand Up @@ -108,6 +109,12 @@ export default {
popperOpts: {
// type: Object,
default: () => {}
},
boundary: {
// String: `scrollParent`, `window` or `viewport`
// HTMLElement: HTML Element reference
type: [String, HTMLElement],
default: 'scrollParent'
}
},
data() {
Expand Down

2 comments on commit 3a50ad8

@bagaskarala
Copy link

@bagaskarala bagaskarala commented on 3a50ad8 Feb 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dropdown

I'm update to 2.4.0 and got this broke dropdown. Im not using b-navbar. I've set boundary to viewport, windows but nothing works

Note: Dropdown button is the bell icon. Navbar not using b-navbar

@tmorehouse
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bagaskarala could you create a new issue with a minimal reproduction of the issue? you can use hte docs playground to export to JsFiddle, Codepen or CodeSandbox.

Please sign in to comment.