8 merge requests!28721Hot test,!27561Adds font-weight-medium to font weight classes,!22598test,!21535remove dropdown.js reliance on roles and fix keyboard navigation,!25326Adjust examples,!23995Add back cursor: pointer for .btn-link,!23178Spinner,!17021v4
@@ -119,7 +119,7 @@ You can also create accordions with custom markup. Add the `data-children` attri
## Accessibility
Be sure to add `aria-expanded` to the control element. This attribute explicitly defines the current state of the collapsible element to screen readers and similar assistive technologies. If the collapsible element is closed by default, it should have a value of `aria-expanded="false"`. If you've set the collapsible element to be open by default using the `show` class, set `aria-expanded="true"` on the control instead. The plugin will automatically toggle this attribute based on whether or not the collapsible element has been opened or closed.
Be sure to add `aria-expanded` to the control element. This attribute explicitly conveys the current state of the collapsible element tied to the control to screen readers and similar assistive technologies. If the collapsible element is closed by default, the attribute on the control element should have a value of `aria-expanded="false"`. If you've set the collapsible element to be open by default using the `show` class, set `aria-expanded="true"` on the control instead. The plugin will automatically toggle this attribute on the control based on whether or not the collapsible element has been opened or closed (via JavaScript, or because the user triggered another control element also tied to the same collapsbile element).
Additionally, if your control element is targeting a single collapsible element – i.e. the `data-target` attribute is pointing to an `id` selector – you may add an additional `aria-controls` attribute to the control element, containing the `id` of the collapsible element. Modern screen readers and similar assistive technologies make use of this attribute to provide users with additional shortcuts to navigate directly to the collapsible element itself.
QUnit.test('should set aria-expanded="true" on target when collapse is shown',function(assert){
QUnit.test('should set aria-expanded="true" on trigger/control when collapse is shown',function(assert){
assert.expect(1)
vardone=assert.async()
...
...
@@ -338,7 +338,7 @@ $(function () {
$target.trigger('click')
})
QUnit.test('should set aria-expanded="false" on target when collapse is hidden',function(assert){
QUnit.test('should set aria-expanded="false" on trigger/control when collapse is hidden',function(assert){
assert.expect(1)
vardone=assert.async()
...
...
@@ -364,8 +364,8 @@ $(function () {
$('<div id="test1"/>')
.appendTo('#qunit-fixture')
.on('shown.bs.collapse',function(){
assert.strictEqual($target.attr('aria-expanded'),'true','aria-expanded on target is "true"')
assert.strictEqual($alt.attr('aria-expanded'),'true','aria-expanded on alt is "true"')
assert.strictEqual($target.attr('aria-expanded'),'true','aria-expanded on trigger/control is "true"')
assert.strictEqual($alt.attr('aria-expanded'),'true','aria-expanded on alternative trigger/control is "true"')
done()
})
...
...
@@ -382,15 +382,15 @@ $(function () {
$('<div id="test1" class="show"/>')
.appendTo('#qunit-fixture')
.on('hidden.bs.collapse',function(){
assert.strictEqual($target.attr('aria-expanded'),'false','aria-expanded on target is "false"')
assert.strictEqual($alt.attr('aria-expanded'),'false','aria-expanded on alt is "false"')
assert.strictEqual($target.attr('aria-expanded'),'false','aria-expanded on trigger/control is "false"')
assert.strictEqual($alt.attr('aria-expanded'),'false','aria-expanded on alternative trigger/control is "false"')
done()
})
$target.trigger('click')
})
QUnit.test('should change aria-expanded from active accordion target to "false" and set the newly active one to "true"',function(assert){
QUnit.test('should change aria-expanded from active accordion trigger/control to "false" and set the trigger/control for the newly active one to "true"',function(assert){