Skip to content
Permalink
Browse files

feat(b-dropdown): add splitClass property to dropdown component (#4394)

* feat(b-dropdown): add splitClass property to dropdown component

* Update package.json
  • Loading branch information
enriquecastl authored and jackmu95 committed Nov 18, 2019
1 parent 1fa25f6 commit a5f342e0e4de2186259e36e42cecda8c20e1c8ab
@@ -60,6 +60,10 @@ export const props = {
type: String,
default: () => getComponentConfig(NAME, 'splitVariant')
},
splitClass: {
type: [String, Array],
default: null
},
splitButtonType: {
type: String,
default: 'button',
@@ -144,6 +148,7 @@ export const BDropdown = /*#__PURE__*/ Vue.extend({
{
ref: 'button',
props: btnProps,
class: this.splitClass,
attrs: {
id: this.safeId('_BV_button_')
},
@@ -368,6 +368,21 @@ describe('dropdown', () => {
wrapper.destroy()
})

it('split should have class specified in split class property', () => {
const splitClass = 'custom-button-class'
const wrapper = mount(BDropdown, {
attachToDocument: true,
propsData: {
splitClass,
split: true
}
})
const $buttons = wrapper.findAll('button')
const $split = $buttons.at(0)

expect($split.classes()).toContain(splitClass)
})

it('menu should have class dropdown-menu-right when prop right set', async () => {
const wrapper = mount(BDropdown, {
attachToDocument: true,
@@ -96,6 +96,11 @@
"prop": "splitButtonType",
"description": "Value to place in the 'type' attribute on the split button: 'button', 'submit', 'reset'"
},
{
"prop": "splitClass",
"version": "2.2.0",
"description": "CSS class (or classes) to add to the split button"
},
{
"prop": "boundary",
"description": "The boundary constraint of the menu: 'scrollParent', 'window', 'viewport', or a reference to an HTMLElement"

0 comments on commit a5f342e

Please sign in to comment.
You can’t perform that action at this time.