Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit 6c26d13

Browse files
author
Steve Keay
committed
fix(BDropdown): set aria-disabled attr when disabled
1 parent 82d670e commit 6c26d13

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

packages/bootstrap-vue-next/src/components/BDropdown/BDropdownItem.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
class="dropdown-item"
66
:class="computedClasses"
77
:disabled="disabledBoolean"
8+
:aria-disabled="disabledBoolean ? true : null"
89
:aria-current="activeBoolean ? true : null"
910
:href="tag === 'a' ? href : null"
1011
:rel="rel"

packages/bootstrap-vue-next/src/components/BDropdown/dropdown-item.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,16 @@ describe('dropdown-item', () => {
148148
expect($button.attributes('disabled')).toBeUndefined()
149149
})
150150

151+
it('button has aria-disabled attr when prop disabled', async () => {
152+
const wrapper = mount(BDropdownItem, {
153+
props: {disabled: true},
154+
})
155+
const $button = wrapper.get('button')
156+
expect($button.attributes('aria-disabled')).toBe('true')
157+
await wrapper.setProps({disabled: false})
158+
expect($button.attributes('aria-disabled')).toBeUndefined()
159+
})
160+
151161
it('button has aria-current attr when prop active', async () => {
152162
const wrapper = mount(BDropdownItem, {
153163
props: {active: true},

0 commit comments

Comments
 (0)