mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-15 01:55:46 +02:00
rm redundant aria-hidden usage from Modals; fixes #16020
This commit is contained in:
@@ -90,9 +90,7 @@
|
||||
that.$element[0].offsetWidth // force reflow
|
||||
}
|
||||
|
||||
that.$element
|
||||
.addClass('in')
|
||||
.attr('aria-hidden', false)
|
||||
that.$element.addClass('in')
|
||||
|
||||
that.enforceFocus()
|
||||
|
||||
@@ -126,7 +124,6 @@
|
||||
|
||||
this.$element
|
||||
.removeClass('in')
|
||||
.attr('aria-hidden', true)
|
||||
.off('click.dismiss.bs.modal')
|
||||
.off('mouseup.dismiss.bs.modal')
|
||||
|
||||
|
@@ -49,18 +49,6 @@ $(function () {
|
||||
.bootstrapModal('show')
|
||||
})
|
||||
|
||||
QUnit.test('should set aria-hidden to false when show method is called', function (assert) {
|
||||
assert.expect(1)
|
||||
var done = assert.async()
|
||||
|
||||
$('<div id="modal-test"/>')
|
||||
.on('shown.bs.modal', function () {
|
||||
assert.strictEqual($('#modal-test').attr('aria-hidden'), 'false', 'aria-hidden is set to string "false" when modal shown')
|
||||
done()
|
||||
})
|
||||
.bootstrapModal('show')
|
||||
})
|
||||
|
||||
QUnit.test('should fire show event', function (assert) {
|
||||
assert.expect(1)
|
||||
var done = assert.async()
|
||||
@@ -106,22 +94,6 @@ $(function () {
|
||||
.bootstrapModal('show')
|
||||
})
|
||||
|
||||
QUnit.test('should set aria-hidden to true when hide is called', function (assert) {
|
||||
assert.expect(2)
|
||||
var done = assert.async()
|
||||
|
||||
$('<div id="modal-test"/>')
|
||||
.on('shown.bs.modal', function () {
|
||||
assert.strictEqual($('#modal-test').length, 1, 'modal has been inserted into the dom')
|
||||
$(this).bootstrapModal('hide')
|
||||
})
|
||||
.on('hidden.bs.modal', function () {
|
||||
assert.strictEqual($('#modal-test').attr('aria-hidden'), 'true', 'aria-hidden is set to string "true" when modal shown')
|
||||
done()
|
||||
})
|
||||
.bootstrapModal('show')
|
||||
})
|
||||
|
||||
QUnit.test('should toggle when toggle is called', function (assert) {
|
||||
assert.expect(3)
|
||||
var done = assert.async()
|
||||
|
@@ -54,7 +54,7 @@
|
||||
<h1>Modal <small>Bootstrap Visual Test</small></h1>
|
||||
</div>
|
||||
|
||||
<div id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
|
||||
<div id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
|
Reference in New Issue
Block a user