Permalink
Browse files

fix(dropdown): fixed aria-labbeledby for non-split dropdowns

  • Loading branch information...
larionov committed Dec 28, 2017
1 parent e311258 commit d597dbce683928246eaf3cf6e386f63b6c9f157b
Showing with 11 additions and 1 deletion.
  1. +1 −1 src/components/dropdown/dropdown.js
  2. +10 −0 src/components/dropdown/dropdown.spec.js
@@ -62,7 +62,7 @@ export default {
class: t.menuClasses,
attrs: {
role: t.role,
'aria-labelledby': t.safeId(split ? '_BV_toggle_' : '_BV_button_')
'aria-labelledby': t.safeId(this.split ? '_BV_toggle_' : '_BV_button_')
},
on: {
mouseover: t.onMouseOver,
@@ -107,4 +107,14 @@ describe('dropdown', async () => {
expect(Array.from(dd_6.$refs.menu.children).filter(node => node.classList.contains('dropdown-divider')).length).toBe(1)
})
it('.dropdown menu aria-labelledby should target `_BV_button_` when not in split mode', async () => {
const { app: { $refs } } = window
const { dd_1 } = $refs // eslint-disable-line camelcase
const menu = Array.from(dd_1.$el.children)
.find(node => node.attributes.role && node.attributes.role.value === 'menu')
expect(menu.attributes['aria-labelledby'].value).toMatch(/_BV_button_$/)
})
})

0 comments on commit d597dbc

Please sign in to comment.