Skip to content

Commit

Permalink
feat(dropdown): add role=presentation to <li> elements for improv…
Browse files Browse the repository at this point in the history
…ed a11y (#3996)

* chore(dropdown): add `role=presentation` to `<li>` elements

* Update dropdown-form.js

* Update dropdown-group.js

* Update dropdown-header.js

* Update dropdown-item-button.js

* Update dropdown-item.js

* Update dropdown-text.js
  • Loading branch information
tmorehouse authored and jacobmllr95 committed Sep 1, 2019
1 parent 484f012 commit 464d257
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/dropdown/dropdown-divider.js
Expand Up @@ -15,7 +15,7 @@ export const BDropdownDivider = /*#__PURE__*/ Vue.extend({
inheritAttrs: false,
props,
render(h, { props, data }) {
return h('li', [
return h('li', { attrs: { role: 'presentation' } }, [
h(
props.tag,
mergeData(data, {
Expand Down
2 changes: 1 addition & 1 deletion src/components/dropdown/dropdown-form.js
Expand Up @@ -14,7 +14,7 @@ export const BDropdownForm = /*#__PURE__*/ Vue.extend({
}
},
render(h, { props, data, children }) {
return h('li', [
return h('li', { attrs: { role: 'presentation' } }, [
h(
BForm,
mergeData(data, {
Expand Down
3 changes: 2 additions & 1 deletion src/components/dropdown/dropdown-group.js
Expand Up @@ -62,14 +62,15 @@ export const BDropdownGroup = /*#__PURE__*/ Vue.extend({
.join(' ')
.trim()

return h('li', [
return h('li', { attrs: { role: 'presentation' } }, [
header || h(),
h(
'ul',
mergeData(data, {
staticClass: 'list-unstyled',
attrs: {
id: props.id || null,
role: 'group',
'aria-describedby': adb || null
}
}),
Expand Down
2 changes: 1 addition & 1 deletion src/components/dropdown/dropdown-header.js
Expand Up @@ -23,7 +23,7 @@ export const BDropdownHeader = /*#__PURE__*/ Vue.extend({
inheritAttrs: false,
props,
render(h, { props, data, children }) {
return h('li', [
return h('li', { attrs: { role: 'presentation' } }, [
h(
props.tag,
mergeData(data, {
Expand Down
2 changes: 1 addition & 1 deletion src/components/dropdown/dropdown-item-button.js
Expand Up @@ -43,7 +43,7 @@ export const BDropdownItemButton = /*#__PURE__*/ Vue.extend({
}
},
render(h) {
return h('li', [
return h('li', { attrs: { role: 'presentation' } }, [
h(
'button',
{
Expand Down
2 changes: 1 addition & 1 deletion src/components/dropdown/dropdown-item.js
Expand Up @@ -37,7 +37,7 @@ export const BDropdownItem = /*#__PURE__*/ Vue.extend({
}
},
render(h) {
return h('li', [
return h('li', { attrs: { role: 'presentation' } }, [
h(
BLink,
{
Expand Down
2 changes: 1 addition & 1 deletion src/components/dropdown/dropdown-text.js
Expand Up @@ -17,7 +17,7 @@ export const BDropdownText = /*#__PURE__*/ Vue.extend({
}
},
render(h, { props, data, children }) {
return h('li', [
return h('li', { attrs: { role: 'presentation' } }, [
h(
props.tag,
mergeData(data, {
Expand Down

0 comments on commit 464d257

Please sign in to comment.